Go string转int

string转int

strconv.Atoi(s string) (i int, err error)

例子

fmt.Println(strconv.Atoi("2147483647"))
//2147483647
fmt.Println(strconv.Atoi("2147483648"))
//2147483647 strconv.ParseInt: parsing "2147483648": value out of range