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

Function Size

proto/wire.go:13–19  ·  view source on GitHub ↗

Size returns the size in bytes of the wire-format encoding of m.

(m Message)

Source from the content-addressed store, hash-verified

11
12// Size returns the size in bytes of the wire-format encoding of m.
13func Size(m Message) int {
14 if m == nil {
15 return 0
16 }
17 mi := MessageV2(m)
18 return protoV2.Size(mi)
19}
20
21// Marshal returns the wire-format encoding of m.
22func Marshal(m Message) ([]byte, error) {

Callers 6

TestMarshalerEncodingFunction · 0.92
TestBufferMarshalAllocsFunction · 0.92
TestMapFieldWithNilBytesFunction · 0.92
benchmarkSizeFunction · 0.92
TestSizeFunction · 0.92
EncodeMessageMethod · 0.85

Calls 2

MessageV2Function · 0.85
SizeMethod · 0.80

Tested by 5

TestMarshalerEncodingFunction · 0.74
TestBufferMarshalAllocsFunction · 0.74
TestMapFieldWithNilBytesFunction · 0.74
benchmarkSizeFunction · 0.74
TestSizeFunction · 0.74