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

Function badPrefix

msgp/errors.go:301–307  ·  view source on GitHub ↗

returns either InvalidPrefixError or TypeError depending on whether or not the prefix is recognized

(want Type, lead byte)

Source from the content-addressed store, hash-verified

299// TypeError depending on whether or not
300// the prefix is recognized
301func badPrefix(want Type, lead byte) error {
302 t := getType(lead)
303 if t == InvalidType {
304 return InvalidPrefixError(lead)
305 }
306 return TypeError{Method: want, Encoded: t}
307}
308
309// InvalidPrefixError is returned when a bad encoding
310// uses a prefix that is not recognized in the MessagePack standard.

Callers 15

peekExtensionFunction · 0.85
peekExtensionHeaderMethod · 0.85
readExtFunction · 0.85
ReadMapHeaderMethod · 0.85
ReadMapKeyPtrMethod · 0.85
ReadArrayHeaderMethod · 0.85
ReadNilMethod · 0.85
ReadFloat64Method · 0.85
ReadFloat32Method · 0.85
ReadBoolMethod · 0.85
ReadInt64Method · 0.85
ReadUint64Method · 0.85

Calls 2

getTypeFunction · 0.85
InvalidPrefixErrorTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…