Greetings!
Question about string
to int conversion using package: strconv
First, strconv.Atoi()
returns type int
.
Second, it appears that strconv.ParseInt()
never returns a type int
. However, the language definition says:
“The bitSize argument 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.”
So, if I do:
n, _ := strconv.ParseInt("42", 10, 0)
n
should be an int
, not int64
. Right? But, it is int64
.
Any ideas?
Thanks,
Deepak.