WriteTo writes the buffered lines to the given writer.
(w io.Writer)
| 135 | |
| 136 | // WriteTo writes the buffered lines to the given writer. |
| 137 | func (t *threadsafeBuffer) WriteTo(w io.Writer) (n int64, err error) { |
| 138 | t.mx.Lock() |
| 139 | defer t.mx.Unlock() |
| 140 | |
| 141 | return t.buf.WriteTo(w) |
| 142 | } |
| 143 | |
| 144 | // Reset resets the buffer to be empty, |
| 145 | // but it retains the underlying storage for use by future writes. |