Skip to content

Commit

Permalink
fix ineffectual assignment of showTypeInStruct (#61)
Browse files Browse the repository at this point in the history
It's enough to declare and assign it when we actually
need it a couple of lines below.
  • Loading branch information
muesli authored and kr committed Jul 20, 2019
1 parent a0c635c commit 71e7e49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,14 @@ 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)
writeByte(pp, ':')
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")
Expand Down

0 comments on commit 71e7e49

Please sign in to comment.