CloseWithError causes further reads from a BytesPipe to return immediately.
(err error)
| 105 | |
| 106 | // CloseWithError causes further reads from a BytesPipe to return immediately. |
| 107 | func (bp *BytesPipe) CloseWithError(err error) error { |
| 108 | bp.mu.Lock() |
| 109 | if err != nil { |
| 110 | bp.closeErr = err |
| 111 | } else { |
| 112 | bp.closeErr = io.EOF |
| 113 | } |
| 114 | bp.wait.Broadcast() |
| 115 | bp.mu.Unlock() |
| 116 | return nil |
| 117 | } |
| 118 | |
| 119 | // Close causes further reads from a BytesPipe to return immediately. |
| 120 | func (bp *BytesPipe) Close() error { |