TakeRedactableBytes returns the buffer contents and reinitializes the buffer. This saves a memory allocation compared to RedactableBytes().
()
| 88 | // contents and reinitializes the buffer. This saves |
| 89 | // a memory allocation compared to RedactableBytes(). |
| 90 | func (b *Buffer) TakeRedactableBytes() m.RedactableBytes { |
| 91 | b.finalize() |
| 92 | r := b.buf |
| 93 | b.buf = nil |
| 94 | b.validUntil = 0 |
| 95 | b.mode = UnsafeEscaped |
| 96 | return m.RedactableBytes(r) |
| 97 | } |
| 98 | |
| 99 | // TakeRedactableString returns the buffer |
| 100 | // contents and reinitializes the buffer. This saves |
no test coverage detected