diff options
author | GagziW <leon.stanko@rwth-aachen.de> | 2018-05-07 16:26:39 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-05-07 16:26:39 +0800 |
commit | d7be5c6619bc1794f79c72a97de5efa81e00bf12 (patch) | |
tree | f26d9159ae0a88f7e03a83af01229a810230a168 /common | |
parent | d2fe83dc5c0b32dfbe45e77817478e06f928ff8a (diff) | |
download | dexon-d7be5c6619bc1794f79c72a97de5efa81e00bf12.tar dexon-d7be5c6619bc1794f79c72a97de5efa81e00bf12.tar.gz dexon-d7be5c6619bc1794f79c72a97de5efa81e00bf12.tar.bz2 dexon-d7be5c6619bc1794f79c72a97de5efa81e00bf12.tar.lz dexon-d7be5c6619bc1794f79c72a97de5efa81e00bf12.tar.xz dexon-d7be5c6619bc1794f79c72a97de5efa81e00bf12.tar.zst dexon-d7be5c6619bc1794f79c72a97de5efa81e00bf12.zip |
common: changed if-else blocks to conform with golint (#16656)
Diffstat (limited to 'common')
-rw-r--r-- | common/bytes.go | 14 |
1 files changed, 6 insertions, 8 deletions
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 { |