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

Function ReadMapKeyZC

msgp/read_bytes.go:210–219  ·  view source on GitHub ↗

ReadMapKeyZC attempts to read a map key from 'b' and returns the key bytes and the remaining bytes Possible errors: - [ErrShortBytes] (too few bytes) - [TypeError] (not a str or bin)

(b []byte)

Source from the content-addressed store, hash-verified

208// - [ErrShortBytes] (too few bytes)
209// - [TypeError] (not a str or bin)
210func ReadMapKeyZC(b []byte) ([]byte, []byte, error) {
211 o, x, err := ReadStringZC(b)
212 if err != nil {
213 if tperr, ok := err.(TypeError); ok && tperr.Encoded == BinType {
214 return ReadBytesZC(b)
215 }
216 return nil, b, err
217 }
218 return o, x, nil
219}
220
221// ReadArrayHeaderBytes attempts to read
222// the array header size off of 'b' and return

Callers 3

TestReadMapKeyFunction · 0.85
FuzzReadBytesFunction · 0.85
readMapStrIntfBytesDepthFunction · 0.85

Calls 2

ReadStringZCFunction · 0.85
ReadBytesZCFunction · 0.85

Tested by 2

TestReadMapKeyFunction · 0.68
FuzzReadBytesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…