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

Method WriteRune

internal/buffer/buffer.go:171–180  ·  view source on GitHub ↗

WriteRune emits a single rune.

(s rune)

Source from the content-addressed store, hash-verified

169
170// WriteRune emits a single rune.
171func (b *Buffer) WriteRune(s rune) error {
172 b.startWrite()
173 l := utf8.RuneLen(s)
174 m, ok := b.tryGrowByReslice(l)
175 if !ok {
176 m = b.grow(l)
177 }
178 _ = utf8.EncodeRune(b.buf[m:], s)
179 return nil
180}
181
182// finalize ensures that all the buffer is properly
183// marked.

Callers 9

TestBufferUnsafeWritesFunction · 0.95
TestBufferRawSafeWritesFunction · 0.95
Example_mixed_writesFunction · 0.95
MakeFormatFunction · 0.45
SafeRuneMethod · 0.45
UnsafeRuneMethod · 0.45
writeRuneMethod · 0.45

Calls 3

startWriteMethod · 0.95
tryGrowByResliceMethod · 0.95
growMethod · 0.95