I have some code that needs to be able to parse a string containing a 64-bit value into an int64. For example, ff11223344556677
is valid, but a downstream system wants that in an int64
.
strconv.ParseInt("ff11223344556677", 16, 64)
gives a range error - it only likes to parse positive integers. Is there a way to go about putting this value into an int64 even though it is going to be negative?