linting
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package shared
|
||||
|
||||
import (
|
||||
"math"
|
||||
"math/big"
|
||||
"strings"
|
||||
|
||||
@@ -46,5 +47,9 @@ func DecodeHexUint8(input string) (uint8, error) {
|
||||
if val.BitLen() > 8 {
|
||||
return 0, errHexOutOfRange
|
||||
}
|
||||
return uint8(val.Uint64()), nil
|
||||
decoded := val.Uint64()
|
||||
if decoded > math.MaxUint8 {
|
||||
return 0, errHexOutOfRange
|
||||
}
|
||||
return uint8(decoded), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user