MCPcopy Index your code
hub / github.com/kopia/kopia / prettyJSON

Function prettyJSON

cli/command_policy_edit.go:120–128  ·  view source on GitHub ↗
(v *policy.Policy)

Source from the content-addressed store, hash-verified

118}
119
120func prettyJSON(v *policy.Policy) string {
121 var b bytes.Buffer
122
123 e := json.NewEncoder(&b)
124 e.SetIndent("", " ")
125 e.Encode(v) //nolint:errcheck,errchkjson
126
127 return b.String()
128}
129
130func jsonEqual(v1, v2 *policy.Policy) bool {
131 return prettyJSON(v1) == prettyJSON(v2)

Callers 2

runMethod · 0.85
jsonEqualFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected