Locate returns a []byte pointing to the field in a messagepack map with the provided key. (The returned []byte points to a sub-slice of 'raw'; Locate does no allocations.) If the key doesn't exist in the map, a zero-length []byte will be returned.
(key string, raw []byte)
| 9 | // points to a sub-slice of 'raw'; Locate does no allocations.) If the |
| 10 | // key doesn't exist in the map, a zero-length []byte will be returned. |
| 11 | func Locate(key string, raw []byte) []byte { |
| 12 | s, n := locate(raw, key) |
| 13 | return raw[s:n] |
| 14 | } |
| 15 | |
| 16 | // Replace takes a key ("key") in a messagepack map ("raw") |
| 17 | // and replaces its value with the one provided and returns |
searching dependent graphs…