From: Odin Ugedal Date: Wed, 7 Dec 2016 08:54:42 +0000 (+0100) Subject: fmt: remove unnecessary else statement X-Git-Tag: go1.8beta2~73 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=8e0c4639f11e9febd34fc1e2465138b37411b9d5;p=gostls13.git fmt: remove unnecessary else statement Change-Id: If30ccfcf56d56fb40102ad567a980793bd39f320 Reviewed-on: https://go-review.googlesource.com/34071 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/fmt/print.go b/src/fmt/print.go index 75301a238e..a95edacc99 100644 --- a/src/fmt/print.go +++ b/src/fmt/print.go @@ -813,16 +813,15 @@ func (p *pp) printValue(value reflect.Value, verb rune, depth int) { if f.Kind() == reflect.Slice && f.IsNil() { p.buf.WriteString(nilParenString) return - } else { - p.buf.WriteByte('{') - for i := 0; i < f.Len(); i++ { - if i > 0 { - p.buf.WriteString(commaSpaceString) - } - p.printValue(f.Index(i), verb, depth+1) + } + p.buf.WriteByte('{') + for i := 0; i < f.Len(); i++ { + if i > 0 { + p.buf.WriteString(commaSpaceString) } - p.buf.WriteByte('}') + p.printValue(f.Index(i), verb, depth+1) } + p.buf.WriteByte('}') } else { p.buf.WriteByte('[') for i := 0; i < f.Len(); i++ {