diff --git a/utils/pretty.go b/utils/pretty.go index 03089a38b..dab0ccb49 100644 --- a/utils/pretty.go +++ b/utils/pretty.go @@ -2,28 +2,15 @@ package utils import ( "bytes" - "encoding/json" "github.com/goccy/go-yaml" ) func PrettyYaml(data interface{}) (result string, err error) { - var marshalled []byte - marshalled, err = json.Marshal(data) - if err != nil { - return - } - - var unmarshalled interface{} - err = json.Unmarshal(marshalled, &unmarshalled) - if err != nil { - return - } - buffer := new(bytes.Buffer) encoder := yaml.NewEncoder(buffer, yaml.Indent(2)) - err = encoder.Encode(unmarshalled) + err = encoder.Encode(data) if err != nil { return }