Reset resets the buffer to be empty, but it retains the underlying storage for use by future writes. It also resets the output mode to UnsafeEscaped.
()
| 275 | // but it retains the underlying storage for use by future writes. |
| 276 | // It also resets the output mode to UnsafeEscaped. |
| 277 | func (b *Buffer) Reset() { |
| 278 | b.buf = b.buf[:0] |
| 279 | b.validUntil = 0 |
| 280 | b.mode = UnsafeEscaped |
| 281 | b.markerOpen = false |
| 282 | } |
| 283 | |
| 284 | // tryGrowByReslice is a inlineable version of grow for the fast-case where the |
| 285 | // internal buffer only needs to be resliced. |
no outgoing calls