Go cheatsheet - String to Number
String to Number
Atoi
k, _ := strconv.Atoi("135")
// k = 135
n, e := strconv.Atoi("wat")
// n = 0, e is not nil
ParseInt
i, _ := strconv.ParseInt("123", 10, 64)
// i = 123
d1, _ := strconv.ParseInt("0x1c8", 0, 64)
// d1 = 456
d2, _ := strconv.Parse...
hn.0xbf.me1 min read