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

Function PrintJSON

internal/cli/format.go:441–445  ·  view source on GitHub ↗

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

(v interface{})

Source from the content-addressed store, hash-verified

439
440// PrintJSON prints any value as indented (human-readable) JSON.
441func PrintJSON(v interface{}) error {
442 enc := json.NewEncoder(os.Stdout)
443 enc.SetIndent("", " ")
444 return enc.Encode(v)
445}
446
447// PrintJSONCompact prints any value as compact (no-indent) JSON — a single
448// 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