MCPcopy
hub / github.com/pquerna/ffjson / WriteString

Method WriteString

fflib/v1/buffer.go:187–190  ·  view source on GitHub ↗

WriteString appends the contents of s to the buffer, growing the buffer as needed. The return value n is the length of s; err is always nil. If the buffer becomes too large, WriteString will panic with ErrTooLarge.

(s string)

Source from the content-addressed store, hash-verified

185// needed. The return value n is the length of s; err is always nil. If the
186// buffer becomes too large, WriteString will panic with ErrTooLarge.
187func (b *Buffer) WriteString(s string) (n int, err error) {
188 m := b.grow(len(s))
189 return copy(b.buf[m:], s), nil
190}
191
192// MinRead is the minimum slice size passed to a Read call by
193// Buffer.ReadFrom. As long as the Buffer has at least MinRead bytes beyond

Callers

nothing calls this directly

Calls 1

growMethod · 0.95

Tested by

no test coverage detected