- // return). This can cause pipew to receive corrupt data, so
- // we first ensure putter() will get an error when calling
- // erc.Close().
- erc.SetError(err)
+ // return). This can cause pipew to receive corrupt data if
+ // err came from copyErr or ctx.Done() before the copy
+ // finished. That's OK, though: in that case err != nil, and
+ // CloseWithErr(err) ensures putter() will get an error from
+ // piper.Read() before seeing EOF.