MCPcopy
hub / github.com/tidwall/gjson / Map

Method Map

gjson.go:313–319  ·  view source on GitHub ↗

Map returns back a map of values. The result should be a JSON object. If the result is not a JSON object, the return value will be an empty map.

()

Source from the content-addressed store, hash-verified

311// Map returns back a map of values. The result should be a JSON object.
312// If the result is not a JSON object, the return value will be an empty map.
313func (t Result) Map() map[string]Result {
314 if t.Type != JSON {
315 return map[string]Result{}
316 }
317 r := t.arrayOrMap('{', false)
318 return r.o
319}
320
321// Get searches result for the specified path.
322// The result should be a JSON array or object.

Callers 3

TestMapFunction · 0.80
TestBasic2Function · 0.80
TestDuplicateKeysFunction · 0.80

Calls 1

arrayOrMapMethod · 0.95

Tested by 3

TestMapFunction · 0.64
TestBasic2Function · 0.64
TestDuplicateKeysFunction · 0.64