Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes. Reset is the same as Truncate(0).
()
| 145 | // but it retains the underlying storage for use by future writes. |
| 146 | // Reset is the same as Truncate(0). |
| 147 | func (t *threadsafeBuffer) Reset() { |
| 148 | t.mx.Lock() |
| 149 | defer t.mx.Unlock() |
| 150 | |
| 151 | t.buf.Reset() |
| 152 | } |
| 153 | |
| 154 | // newThreadsafeBuffer returns a new threadsafeBuffer wrapping the given bytes.Buffer. |
| 155 | func newThreadsafeBuffer(buf *bytes.Buffer) *threadsafeBuffer { |
no outgoing calls