MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / CompareJSON

Function CompareJSON

dgraphapi/json.go:50–60  ·  view source on GitHub ↗

CompareJSON compares two JSON objects (passed as strings).

(want, got string)

Source from the content-addressed store, hash-verified

48
49// CompareJSON compares two JSON objects (passed as strings).
50func CompareJSON(want, got string) error {
51 wantMap, err := unmarshalJSON(want)
52 if err != nil {
53 return err
54 }
55 gotMap, err := unmarshalJSON(got)
56 if err != nil {
57 return err
58 }
59 return compareJSONMaps(wantMap, gotMap)
60}
61
62// compareJSONMaps compares two JSON objects (passed as maps).
63func compareJSONMaps(wantMap, gotMap map[string]interface{}) error {

Calls 2

unmarshalJSONFunction · 0.85
compareJSONMapsFunction · 0.85