From ca4706f118d4cfb559d84c7a726f99673d42f7d4 Mon Sep 17 00:00:00 2001 From: pauhull Date: Thu, 9 Nov 2023 17:46:10 +0100 Subject: [PATCH] feat: pretty-print JSON output (#610) This PR makes the JSON output (for example when using `... describe -o=json`) properly formatted, with 2 spaces as indent. --- internal/cmd/util/util.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/cmd/util/util.go b/internal/cmd/util/util.go index 6c332d88..05d44149 100644 --- a/internal/cmd/util/util.go +++ b/internal/cmd/util/util.go @@ -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) }