From d7be5c6619bc1794f79c72a97de5efa81e00bf12 Mon Sep 17 00:00:00 2001 From: GagziW Date: Mon, 7 May 2018 01:26:39 -0700 Subject: common: changed if-else blocks to conform with golint (#16656) --- common/bytes.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'common') diff --git a/common/bytes.go b/common/bytes.go index ba00e8a4b..e2adc8005 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -87,15 +87,13 @@ func Hex2BytesFixed(str string, flen int) []byte { h, _ := hex.DecodeString(str) if len(h) == flen { return h - } else { - if len(h) > flen { - return h[len(h)-flen:] - } else { - hh := make([]byte, flen) - copy(hh[flen-len(h):flen], h[:]) - return hh - } } + if len(h) > flen { + return h[len(h)-flen:] + } + hh := make([]byte, flen) + copy(hh[flen-len(h):flen], h[:]) + return hh } func RightPadBytes(slice []byte, l int) []byte { -- cgit v1.2.3