Skip to content

Commit

Permalink
feat: pretty-print JSON output (#610)
Browse files Browse the repository at this point in the history
This PR makes the JSON output (for example when using `... describe
-o=json`) properly formatted, with 2 spaces as indent.
  • Loading branch information
phm07 committed Nov 9, 2023
1 parent 765bc3f commit ca4706f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/cmd/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func DescribeFormat(object interface{}, format string) error {

func DescribeJSON(object interface{}) error {
enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ")
return enc.Encode(object)
}

Expand Down

0 comments on commit ca4706f

Please sign in to comment.