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)
| 208 | // - [ErrShortBytes] (too few bytes) |
| 209 | // - [TypeError] (not a str or bin) |
| 210 | func 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 |
searching dependent graphs…