Close releases the diode poller and call Close on the wrapped writer if io.Closer is implemented.
()
| 82 | // Close releases the diode poller and call Close on the wrapped writer if |
| 83 | // io.Closer is implemented. |
| 84 | func (dw Writer) Close() error { |
| 85 | dw.c() |
| 86 | <-dw.done |
| 87 | if w, ok := dw.w.(io.Closer); ok { |
| 88 | return w.Close() |
| 89 | } |
| 90 | return nil |
| 91 | } |
| 92 | |
| 93 | func (dw Writer) poll() { |
| 94 | defer close(dw.done) |
no outgoing calls