MCPcopy
hub / github.com/golang/protobuf / NewBuffer

Function NewBuffer

proto/buffer.go:57–59  ·  view source on GitHub ↗

NewBuffer allocates a new Buffer initialized with buf, where the contents of buf are considered the unread portion of the buffer.

(buf []byte)

Source from the content-addressed store, hash-verified

55// NewBuffer allocates a new Buffer initialized with buf,
56// where the contents of buf are considered the unread portion of the buffer.
57func NewBuffer(buf []byte) *Buffer {
58 return &Buffer{buf: buf}
59}
60
61// SetDeterministic specifies whether to use deterministic serialization.
62//

Callers 2

TestMarshalerEncodingFunction · 0.92
benchmarkBufferMarshalFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestMarshalerEncodingFunction · 0.74
benchmarkBufferMarshalFunction · 0.74