MCPcopy
hub / github.com/cli/cli / compactJSON

Function compactJSON

pkg/cmd/discussion/view/view_test.go:1224–1230  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

1222}
1223
1224func compactJSON(s string) string {
1225 var buf bytes.Buffer
1226 if err := json.Compact(&buf, []byte(s)); err != nil {
1227 panic(fmt.Sprintf("compactJSON: %v", err))
1228 }
1229 return buf.String() + "\n"
1230}
1231
1232func jsonExporter(fields ...string) cmdutil.Exporter {
1233 e := cmdutil.NewJSONExporter()

Callers 1

TestViewRunFunction · 0.70

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected