MCPcopy Create free account
hub / github.com/CrowdStrike/csproto / Size

Method Size

encoder_test.go:810–826  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

808}
809
810func (m *testNestedMsg) Size() int {
811 if m == nil {
812 return 0
813 }
814 var (
815 sz = 0
816 l int
817 )
818 if m.Name != nil {
819 l = len(*m.Name)
820 sz += 1 + csproto.SizeOfVarint(uint64(l)) + l
821 }
822 if m.Value != nil {
823 sz += 1 + csproto.SizeOfVarint(uint64(*m.Value))
824 }
825 return sz
826}
827
828func (m *testNestedMsg) MarshalTo(dest []byte) error {
829 enc := csproto.NewEncoder(dest)

Callers 1

TestEncodeNestedFunction · 0.95

Calls 1

SizeOfVarintFunction · 0.92

Tested by

no test coverage detected