MCPcopy Create free account
hub / github.com/cli/cli / compactJSON

Function compactJSON

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

Source from the content-addressed store, hash-verified

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

Callers 1

TestViewRunFunction · 0.70

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected