MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / writeJSON

Function writeJSON

internal/cli/provider_cmd.go:624–632  ·  view source on GitHub ↗

writeJSON pretty-prints v as 2-space indented JSON with a trailing newline.

(out io.Writer, v any)

Source from the content-addressed store, hash-verified

622
623// writeJSON pretty-prints v as 2-space indented JSON with a trailing newline.
624func writeJSON(out io.Writer, v any) error {
625 data, err := json.MarshalIndent(v, "", " ")
626 if err != nil {
627 return err
628 }
629 data = append(data, '\n')
630 _, err = out.Write(data)
631 return err
632}
633
634// inIsTTY reports whether the supplied reader is a *os.File backed by a
635// terminal. Tests using bytes.Buffer return false, which is what we want

Callers 2

providerListCommandMethod · 0.70
providerShowCommandMethod · 0.70

Calls 1

WriteMethod · 0.80

Tested by

no test coverage detected