MCPcopy
hub / github.com/buger/jsonparser / Get

Function Get

parser.go:992–995  ·  view source on GitHub ↗

* Get - Receives data structure, and key path to extract value from. Returns: `value` - Pointer to original data structure containing key value, or just empty slice if nothing found or error `dataType` - Can be: `NotExist`, `String`, `Number`, `Object`, `Array`, `Boolean` or `Null` `offset` - Of

(data []byte, keys ...string)

Source from the content-addressed store, hash-verified

990*/
991// SYS-REQ-001, SYS-REQ-016, SYS-REQ-017, SYS-REQ-018, SYS-REQ-019, SYS-REQ-025, SYS-REQ-026, SYS-REQ-041, SYS-REQ-042, SYS-REQ-043
992func Get(data []byte, keys ...string) (value []byte, dataType ValueType, offset int, err error) {
993 a, b, _, d, e := internalGet(data, keys...)
994 return a, b, d, e
995}
996
997// SYS-REQ-001
998func internalGet(data []byte, keys ...string) (value []byte, dataType ValueType, offset, endOffset int, err error) {

Callers 15

BenchmarkJsonParserSmallFunction · 0.92
BenchmarkJsonParserLargeFunction · 0.92
TestGetDeterminismFunction · 0.85
TestGetNilSafetyFunction · 0.85
TestGetDeepNestingFunction · 0.85
TestMutationUnicodeKeysFunction · 0.85
TestGetFunction · 0.85
TestGetRequirementSlicesFunction · 0.85

Calls 1

internalGetFunction · 0.85

Tested by 15

BenchmarkJsonParserSmallFunction · 0.74
BenchmarkJsonParserLargeFunction · 0.74
TestGetDeterminismFunction · 0.68
TestGetNilSafetyFunction · 0.68
TestGetDeepNestingFunction · 0.68
TestMutationUnicodeKeysFunction · 0.68
TestGetFunction · 0.68
TestGetRequirementSlicesFunction · 0.68