MCPcopy
hub / github.com/dgraph-io/dgraph / UnmarshalJSON

Function UnmarshalJSON

testutil/json.go:41–49  ·  view source on GitHub ↗

UnmarshalJSON unmarshals the given string into a map.

(t *testing.T, jsonStr string)

Source from the content-addressed store, hash-verified

39
40// UnmarshalJSON unmarshals the given string into a map.
41func UnmarshalJSON(t *testing.T, jsonStr string) map[string]interface{} {
42 jsonMap := map[string]interface{}{}
43 err := json.Unmarshal([]byte(jsonStr), &jsonMap)
44 if err != nil {
45 t.Fatalf("Could not unmarshal want JSON: %v", err)
46 }
47
48 return jsonMap
49}
50
51// DiffJSONMaps compares two JSON maps, optionally printing their differences,
52// and returning true if they are equal.

Callers 5

checkUpsertLoadedDataFunction · 0.92
checkLoadedDataFunction · 0.92
PollTillPassOrTimeoutFunction · 0.85
CompareJSONFunction · 0.85
EqualJSONFunction · 0.85

Calls 1

FatalfMethod · 0.80

Tested by 2

checkUpsertLoadedDataFunction · 0.74
checkLoadedDataFunction · 0.74