MCPcopy Create free account
hub / github.com/pquerna/ffjson / NewBuffer

Function NewBuffer

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

NewBuffer creates and initializes a new Buffer using buf as its initial contents. It is intended to prepare a Buffer to read existing data. It can also be used to size the internal buffer for writing. To do that, buf should have the desired capacity but a length of zero. In most cases, new(Buffer

(buf []byte)

Source from the content-addressed store, hash-verified

409// In most cases, new(Buffer) (or just declaring a Buffer variable) is
410// sufficient to initialize a Buffer.
411func NewBuffer(buf []byte) *Buffer { return &Buffer{buf: buf} }
412
413// NewBufferString creates and initializes a new Buffer using string s as its
414// initial contents. It is intended to prepare a buffer to read an existing

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…