string到int
int,err:=strconv.Atoi(string)
string到int64
int64, err := strconv.ParseInt(string, 10, 64)
int到string
string:=strconv.Itoa(int)
int64到string
string:=strconv.FormatInt(int64,10)
string 不能直接和byte数组转换
string可以和byte的切片转换
1,string 转为[]byte
var str string = "test"
var data []byte = []byte(str)
2,byte转为string
var data [10]byte
byte[0] = 'T'
byte[1] = 'E'
var str string = string(data[:])