Reset the path buffer to empty, keeping and reusing the underlying bytes.
()
| 157 | |
| 158 | // Reset the path buffer to empty, keeping and reusing the underlying bytes. |
| 159 | func (b *PathBuffer) Reset() { |
| 160 | b.buf = b.buf[:0] |
| 161 | b.off = 0 |
| 162 | } |
| 163 | |
| 164 | // NewPathBuffer creates a new path buffer given an existing byte slice. |
| 165 | // Tip: using `sync.Pool` can significantly reduce buffer allocations. |
no outgoing calls