MCPcopy
hub / github.com/protocolbuffers/protobuf-go / Size

Function Size

proto/size.go:19–21  ·  view source on GitHub ↗

Size returns the size in bytes of the wire-format encoding of m. Note that Size might return more bytes than Marshal will write in the case of lazily decoded messages that arrive in non-minimal wire format: see https://protobuf.dev/reference/go/size/ for more details.

(m Message)

Source from the content-addressed store, hash-verified

17// lazily decoded messages that arrive in non-minimal wire format: see
18// https://protobuf.dev/reference/go/size/ for more details.
19func Size(m Message) int {
20 return MarshalOptions{}.Size(m)
21}
22
23// Size returns the size in bytes of the wire-format encoding of m.
24//

Callers 14

TestLegacyMarshalMethodFunction · 0.92
TestNilFunction · 0.92
TestEncodeFunction · 0.92
TestEncodeLargeFunction · 0.92
compareEquivalentProtosFunction · 0.92
ExampleSizeFunction · 0.92
TestMessageSetLazyFunction · 0.92
TestExtensionLazyFunction · 0.92

Calls 1

SizeMethod · 0.45

Tested by 13

TestLegacyMarshalMethodFunction · 0.74
TestNilFunction · 0.74
TestEncodeFunction · 0.74
TestEncodeLargeFunction · 0.74
compareEquivalentProtosFunction · 0.74
ExampleSizeFunction · 0.74
TestMessageSetLazyFunction · 0.74
TestExtensionLazyFunction · 0.74