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

Function PrintJSON

internal/cli/format.go:509–513  ·  view source on GitHub ↗

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

(v interface{})

Source from the content-addressed store, hash-verified

507
508// PrintJSON prints any value as indented (human-readable) JSON.
509func PrintJSON(v interface{}) error {
510 enc := json.NewEncoder(os.Stdout)
511 enc.SetIndent("", " ")
512 return enc.Encode(v)
513}
514
515// PrintJSONCompact prints any value as compact (no-indent) JSON — a single
516// line plus trailing newline. Preferred for machine-consumed payloads where

Callers 15

timezoneCmdFunction · 0.92
setAsideCmdFunction · 0.92
readyCmdFunction · 0.92
staleCmdFunction · 0.92
relatedCmdFunction · 0.92
implementedByCmdFunction · 0.92
remindRenegotiateCmdFunction · 0.92
myInvitationsCmdFunction · 0.92
workspaceRestoreCmdFunction · 0.92
workspaceDeletedCmdFunction · 0.92
workspaceCreateCmdFunction · 0.92
workspaceClaimCmdFunction · 0.92

Calls 1

EncodeMethod · 0.65

Tested by

no test coverage detected