mirror of
https://github.com/therootcompany/golib.git
synced 2025-10-07 01:28:19 +00:00
fix(colorjson): apply DisabledColor to keys as well
This commit is contained in:
parent
6e394bc15a
commit
045480f900
@ -100,7 +100,11 @@ func (f *Formatter) marshalMap(m map[string]interface{}, buf *bytes.Buffer, dept
|
|||||||
|
|
||||||
for _, key := range keys {
|
for _, key := range keys {
|
||||||
f.writeIndent(buf, depth+1)
|
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)
|
f.marshalValue(m[key], buf, depth+1)
|
||||||
remaining--
|
remaining--
|
||||||
if remaining != 0 {
|
if remaining != 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user