setBuffer initializes the pipe buffer. It has no effect if the pipe is already closed.
(b pipeBuffer)
| 33 | // setBuffer initializes the pipe buffer. |
| 34 | // It has no effect if the pipe is already closed. |
| 35 | func (p *pipe) setBuffer(b pipeBuffer) { |
| 36 | p.mu.Lock() |
| 37 | defer p.mu.Unlock() |
| 38 | if p.err != nil || p.breakErr != nil { |
| 39 | return |
| 40 | } |
| 41 | p.b = b |
| 42 | } |
| 43 | |
| 44 | func (p *pipe) Len() int { |
| 45 | p.mu.Lock() |
no test coverage detected