From 045480f9005b3b6962ad21677876c01c82fc4571 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 2 Oct 2025 23:58:21 -0600 Subject: [PATCH] fix(colorjson): apply DisabledColor to keys as well --- colorjson/colorjson.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/colorjson/colorjson.go b/colorjson/colorjson.go index 948247c..6c9b445 100644 --- a/colorjson/colorjson.go +++ b/colorjson/colorjson.go @@ -100,7 +100,11 @@ func (f *Formatter) marshalMap(m map[string]interface{}, buf *bytes.Buffer, dept for _, key := range keys { f.writeIndent(buf, depth+1) - buf.WriteString(f.KeyColor.Sprintf("\"%s\": ", key)) + if f.DisabledColor { + fmt.Fprintf(buf, "\"%s\": ", key) + } else { + buf.WriteString(f.KeyColor.Sprintf("\"%s\"", key) + ": ") + } f.marshalValue(m[key], buf, depth+1) remaining-- if remaining != 0 {