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

Method Write

_generated/errorwrap_test.go:53–65  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

51}
52
53func (o *dodgifierBuf) Write(b []byte) (n int, err error) {
54 ilen := len(b)
55 if msgp.NextType(b) == msgp.StrType {
56 if o.strIdx == o.dodgifyString {
57 // Fool msgp into thinking this value is a fixint. msgp will throw
58 // a type error for this value.
59 b[0] = 1
60 }
61 o.strIdx++
62 }
63 _, err = o.Buffer.Write(b)
64 return ilen, err
65}
66
67type strCounter int
68

Callers

nothing calls this directly

Calls 2

NextTypeFunction · 0.92
WriteMethod · 0.45

Tested by

no test coverage detected