From eb37fc8d07998751053d94fb51e6f53ca0df1a8c Mon Sep 17 00:00:00 2001 From: Todd Date: Thu, 16 Jun 2022 14:13:13 -0700 Subject: [PATCH] Quote tags before printing them out. (#2211) --- internal/cmd/base/format.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/cmd/base/format.go b/internal/cmd/base/format.go index ea269680bb..792dde95a6 100644 --- a/internal/cmd/base/format.go +++ b/internal/cmd/base/format.go @@ -139,6 +139,15 @@ func WrapMap(prefixSpaces, maxLengthOverride int, input map[string]interface{}) if spaces < 0 { spaces = 0 } + + if sv, ok := v.([]string); ok { + nv := make([]string, 0, len(sv)) + for _, si := range sv { + nv = append(nv, fmt.Sprintf("%q", si)) + } + v = nv + } + vOut := fmt.Sprintf("%v", v) switch v.(type) { case map[string]interface{}: