Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
common: changed if-else blocks to conform with golint (#16656)
Browse files Browse the repository at this point in the history
  • Loading branch information
GagziW authored and gbalint committed May 23, 2018
1 parent 7183d05 commit ea1b62c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions common/bytes.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,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 {
Expand Down

0 comments on commit ea1b62c

Please sign in to comment.