一、字符串转int
func Atoi(s string) (int, error)

案例:
golang 字符串与int类型转换_第1张图片
执行结果:
sf@SFdeMacBook-Pro  ~/Documents/project/src/test  go build int_string.go
sf@SFdeMacBook-Pro  ~/Documents/project/src/test  ./int_string
int, 100

二、int转字符串
func Itoa(i int) string

golang 字符串与int类型转换

执行结果:
sf@SFdeMacBook-Pro  ~/Documents/project/src/test  go build int_string.go
sf@SFdeMacBook-Pro  ~/Documents/project/src/test  ./int_string
string,100