1. 其他类型转化为String 使用fmt.Sprintf("%d" , x) 转化 常用的占位符如下: 使用strconv转化: //string 转为int i, err := strconv.Atoi(s) 2. String转为其他类型 有两个函数可以实现类型的互转 1,FormateInt(int , base int) string 2, Itoa(int) string //int 转化为string s := strconv.Itoa(i) s := strconv.FormatInt(int64(i), 10) //强制转化为int64后使用FormatInt