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

Function writeNext

msgp/json_bytes.go:62–80  ·  view source on GitHub ↗
(w jsWriter, msg []byte, scratch []byte, depth int)

Source from the content-addressed store, hash-verified

60}
61
62func writeNext(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) {
63 if len(msg) < 1 {
64 return msg, scratch, ErrShortBytes
65 }
66 t := getType(msg[0])
67 if t == InvalidType {
68 return msg, scratch, InvalidPrefixError(msg[0])
69 }
70 if t == ExtensionType {
71 et, err := peekExtension(msg)
72 if err != nil {
73 return nil, scratch, err
74 }
75 if et == TimeExtension || et == MsgTimeExtension {
76 t = TimeType
77 }
78 }
79 return unfuns[t](w, msg, scratch, depth)
80}
81
82func rwArrayBytes(w jsWriter, msg []byte, scratch []byte, depth int) ([]byte, []byte, error) {
83 if depth >= recursionLimit {

Callers 3

UnmarshalAsJSONFunction · 0.85
rwArrayBytesFunction · 0.85
rwMapBytesFunction · 0.85

Calls 3

getTypeFunction · 0.85
InvalidPrefixErrorTypeAlias · 0.85
peekExtensionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…