remove removes the last n bytes from the buffer.
(n int)
| 98 | |
| 99 | // remove removes the last n bytes from the buffer. |
| 100 | func (b *buffer) remove(n int) { |
| 101 | n = max(0, n) |
| 102 | trimTo := max(0, len(*b)-n) |
| 103 | *b = (*b)[:trimTo] |
| 104 | } |
| 105 | |
| 106 | // removeNewline removes the trailing newline character from the buffer, if present. |
| 107 | func (b *buffer) removeNewline() { |