可以利用strconv包中的Atoi函数将一个string转换为整型,如下:
import strconv func myFunc() { number, err = strconv.Atoi("123") }
Last updated 5 years ago
Was this helpful?