MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / PrintJSON

Function PrintJSON

internal/cli/format.go:420–424  ·  view source on GitHub ↗

PrintJSON prints any value as indented (human-readable) JSON.

(v interface{})

Source from the content-addressed store, hash-verified

418
419// PrintJSON prints any value as indented (human-readable) JSON.
420func PrintJSON(v interface{}) error {
421 enc := json.NewEncoder(os.Stdout)
422 enc.SetIndent("", " ")
423 return enc.Encode(v)
424}
425
426// PrintJSONCompact prints any value as compact (no-indent) JSON — a single
427// line plus trailing newline. Preferred for machine-consumed payloads where

Callers 15

readyCmdFunction · 0.92
staleCmdFunction · 0.92
relatedCmdFunction · 0.92
implementedByCmdFunction · 0.92
workspaceRestoreCmdFunction · 0.92
workspaceDeletedCmdFunction · 0.92
workspaceCreateCmdFunction · 0.92
workspaceClaimCmdFunction · 0.92
workspacesCmdFunction · 0.92
noteCmdFunction · 0.92
decideCmdFunction · 0.92
reconcileCmdFunction · 0.92

Calls 1

EncodeMethod · 0.65

Tested by

no test coverage detected