From 8e0c4639f11e9febd34fc1e2465138b37411b9d5 Mon Sep 17 00:00:00 2001 From: Odin Ugedal Date: Wed, 7 Dec 2016 09:54:42 +0100 Subject: [PATCH] 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 --- src/fmt/print.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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++ { -- 2.50.0