I am trying to parse a string into an integer in Go. The Problem I found with it is in the documentation its mentioned syntax is as follows:
ParseInt(s string, base int, bitSize int)
where, s
is the string to be parsed, base
is implied by the string's prefix: base 16 for "0x", base 8 for "0", and base 10 otherwise.
The bitSize
parameter is where I am facing problem. As per documentation of ParseInt, it specifies the integer type that the result must fit into. Bit sizes 0, 8, 16, 32, and 64 correspond to int, int8, int16, int32, and int64.
But for all the values like 0, 8, 16, 32, and 64. I am getting same type return value. I.e of int64 type.
Could anyone point me out what am I missing.