CloseWithError closes the reader; subsequent writes to the write half of the pipe will return the error err.
(err error)
| 164 | // CloseWithError closes the reader; subsequent writes to the write half of the |
| 165 | // pipe will return the error err. |
| 166 | func (r *pipeReader) CloseWithError(err error) error { |
| 167 | r.cond.L.Lock() |
| 168 | defer r.cond.L.Unlock() |
| 169 | |
| 170 | if err == nil { |
| 171 | err = ErrClosedPipe |
| 172 | } |
| 173 | r.werr = err |
| 174 | return nil |
| 175 | } |
| 176 | |
| 177 | // Write implements the standard Write interface: it writes data to the internal |
| 178 | // buffer. If the read end is closed with an error, that err is returned as err; |
no test coverage detected