From 1c03bd3a96caaff886dd0a08d4d3133a450e6f59 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Sat, 20 Jul 2019 07:02:02 +0200 Subject: [PATCH] Fixed ineffectual assignment of showTypeInStruct It's enough to declare and assign it when we actually need it a couple of lines below. --- formatter.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/formatter.go b/formatter.go index a317d7b..df61d8d 100644 --- a/formatter.go +++ b/formatter.go @@ -125,7 +125,6 @@ func (p *printer) printValue(v reflect.Value, showType, quote bool) { } keys := v.MapKeys() for i := 0; i < v.Len(); i++ { - showTypeInStruct := true k := keys[i] mv := v.MapIndex(k) pp.printValue(k, false, true) @@ -133,7 +132,7 @@ func (p *printer) printValue(v reflect.Value, showType, quote bool) { if expand { writeByte(pp, '\t') } - showTypeInStruct = t.Elem().Kind() == reflect.Interface + showTypeInStruct := t.Elem().Kind() == reflect.Interface pp.printValue(mv, showTypeInStruct, true) if expand { io.WriteString(pp, ",\n")