MCPcopy Create free account
hub / github.com/cockroachdb/redact / finalize

Method finalize

internal/buffer/buffer.go:184–194  ·  view source on GitHub ↗

finalize ensures that all the buffer is properly marked.

()

Source from the content-addressed store, hash-verified

182// finalize ensures that all the buffer is properly
183// marked.
184func (b *Buffer) finalize() {
185 if b.mode == SafeRaw {
186 b.validUntil = len(b.buf)
187 } else {
188 b.escapeToEnd(b.mode == UnsafeEscaped /* breakNewLines */)
189 }
190 if b.markerOpen {
191 b.endRedactable()
192 b.validUntil = len(b.buf)
193 }
194}
195
196// endRedactable adds the closing redaction marker.
197func (b *Buffer) endRedactable() {

Callers 7

RedactableBytesMethod · 0.95
RedactableStringMethod · 0.95
StringMethod · 0.95
TakeRedactableBytesMethod · 0.95
TakeRedactableStringMethod · 0.95
checkInvariantsMethod · 0.80
LenMethod · 0.80

Calls 2

escapeToEndMethod · 0.95
endRedactableMethod · 0.95

Tested by 1

checkInvariantsMethod · 0.64