Here's my code:
package main
import (
"fmt"
"reflect"
"strconv"
)
func main() {
i, _ := strconv.ParseInt("10", 10, 8)
fmt.Println(reflect.TypeOf(i))
}
I expect i
to be 8-bits long (the 3rd argument to strconv.ParseInt
). It is int64, however (and the docs state that strconv.ParseInt
will return int64).
What's the point of ParseInt if it always returns int64 (why not just use Atoi?)