MCPcopy Create free account
hub / github.com/aws-cloudformation/rain / CompareMaps

Function CompareMaps

cft/diff/compare.go:57–77  ·  view source on GitHub ↗
(old, new map[string]interface{})

Source from the content-addressed store, hash-verified

55}
56
57func CompareMaps(old, new map[string]interface{}) Diff {
58 d := make(dmap)
59
60 // New and updated keys
61 for key, val := range new {
62 if _, ok := old[key]; !ok {
63 d[key] = value{val, Added}
64 } else {
65 d[key] = compareValues(old[key], val)
66 }
67 }
68
69 // Removed keys
70 for key, val := range old {
71 if _, ok := new[key]; !ok {
72 d[key] = value{val, Removed}
73 }
74 }
75
76 return d
77}

Callers 4

showChangesetFunction · 0.92
handleDriftFunction · 0.92
NewFunction · 0.85
compareValuesFunction · 0.85

Calls 1

compareValuesFunction · 0.85

Tested by

no test coverage detected