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

Method Write

fflib/v1/buffer.go:176–182  ·  view source on GitHub ↗

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

(p []byte)

Source from the content-addressed store, hash-verified

174// needed. The return value n is the length of p; err is always nil. If the
175// buffer becomes too large, Write will panic with ErrTooLarge.
176func (b *Buffer) Write(p []byte) (n int, err error) {
177 if b.skipTrailingByte {
178 p = p[:len(p)-1]
179 }
180 m := b.grow(len(p))
181 return copy(b.buf[m:], p), nil
182}
183
184// WriteString appends the contents of s to the buffer, growing the buffer as
185// needed. The return value n is the length of s; err is always nil. If the

Callers 14

WriteRuneMethod · 0.95
TestHTMLEscapeFunction · 0.95
WriteJsonFunction · 0.45
formatDigitsFunction · 0.45
fmtEFunction · 0.45
fmtFFunction · 0.45
formatBitsFunction · 0.45
handleEscapedMethod · 0.45
SliceStringMethod · 0.45
WriteToMethod · 0.45
wantBytesMethod · 0.45
lexNumberMethod · 0.45

Calls 1

growMethod · 0.95

Tested by 1

TestHTMLEscapeFunction · 0.76