MCPcopy Create free account
hub / github.com/apache/openwhisk-cli / printJsonNoColor

Function printJsonNoColor

commands/util.go:645–659  ·  view source on GitHub ↗
(decoded interface{}, stream ...io.Writer)

Source from the content-addressed store, hash-verified

643}
644
645func printJsonNoColor(decoded interface{}, stream ...io.Writer) {
646 var output bytes.Buffer
647
648 buffer := new(bytes.Buffer)
649 encoder := json.NewEncoder(buffer)
650 encoder.SetEscapeHTML(false)
651 encoder.Encode(&decoded)
652 json.Indent(&output, buffer.Bytes(), "", " ")
653
654 if len(stream) > 0 {
655 fmt.Fprintf(stream[0], "%s", string(output.Bytes()))
656 } else {
657 fmt.Fprintf(os.Stdout, "%s", string(output.Bytes()))
658 }
659}
660
661func unpackGzip(inpath string, outpath string) error {
662 var exists bool

Callers 1

printJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected