MCPcopy
hub / github.com/kopia/kopia / jsonIndentedBytes

Method jsonIndentedBytes

cli/json_output.go:70–87  ·  view source on GitHub ↗
(v any, indent string)

Source from the content-addressed store, hash-verified

68}
69
70func (c *jsonOutput) jsonIndentedBytes(v any, indent string) []byte {
71 v = c.cleanupForJSON(v)
72
73 var (
74 b []byte
75 err error
76 )
77
78 if c.jsonIndent {
79 b, err = json.MarshalIndent(v, indent+"", indent+" ")
80 } else {
81 b, err = json.Marshal(v)
82 }
83
84 impossible.PanicOnError(err)
85
86 return b
87}
88
89type jsonList struct {
90 separator string

Callers 3

jsonBytesMethod · 0.95
reportSnapshotStatusMethod · 0.80
runMethod · 0.80

Calls 2

cleanupForJSONMethod · 0.95
PanicOnErrorFunction · 0.92

Tested by

no test coverage detected