MCPcopy
hub / github.com/tinylib/msgp / countStrings

Function countStrings

_generated/errorwrap_test.go:76–88  ·  view source on GitHub ↗
(bts []byte)

Source from the content-addressed store, hash-verified

74}
75
76func countStrings(bts []byte) int {
77 r := msgp.NewReader(bytes.NewReader(bts))
78 strCounter := strCounter(0)
79 for {
80 _, err := r.CopyNext(&strCounter)
81 if err == io.EOF {
82 break
83 } else if err != nil {
84 panic(err)
85 }
86 }
87 return int(strCounter)
88}
89
90func marshalErrorCtx(m msgp.Marshaler) []byte {
91 bts, err := m.MarshalMsg(nil)

Callers 4

TestErrorCtxAsMapDecodeFunction · 0.85

Calls 3

CopyNextMethod · 0.95
NewReaderFunction · 0.92
strCounterTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…