MCPcopy Index your code
hub / github.com/yusing/godoxy / printJSON

Function printJSON

cmd/cli/cli.go:414–427  ·  view source on GitHub ↗
(payload []byte)

Source from the content-addressed store, hash-verified

412}
413
414func printJSON(payload []byte) {
415 if len(payload) == 0 {
416 fmt.Println("null")
417 return
418 }
419 var v any
420 if err := json.Unmarshal(payload, &v); err != nil {
421 fmt.Println(strings.TrimSpace(string(payload)))
422 return
423 }
424 enc := json.NewEncoder(os.Stdout)
425 enc.SetIndent("", " ")
426 _ = enc.Encode(v)
427}
428
429func printHelp() {
430 fmt.Println("godoxy [--addr ADDR] <command>")

Callers 1

execHTTPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected