MCPcopy Index your code
hub / github.com/CodisLabs/codis / WriteString

Method WriteString

pkg/utils/bufio2/bufio.go:259–272  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

257}
258
259func (b *Writer) WriteString(s string) (nn int, err error) {
260 for b.err == nil && len(s) > b.available() {
261 n := copy(b.buf[b.wpos:], s)
262 b.wpos += n
263 b.flush()
264 nn, s = nn+n, s[n:]
265 }
266 if b.err != nil || len(s) == 0 {
267 return nn, b.err
268 }
269 n := copy(b.buf[b.wpos:], s)
270 b.wpos += n
271 return nn + n, nil
272}

Callers 4

TestWriteStringFunction · 0.80
initFunction · 0.80
encodeTextBytesMethod · 0.80
encodeTextStringMethod · 0.80

Calls 2

availableMethod · 0.95
flushMethod · 0.95

Tested by 1

TestWriteStringFunction · 0.64