golang 中string和int类型相互转换

### string转成intint, err := strconv.Atoi(string)
### string转成int64int64, err := strconv.ParseInt(string, 10, 64)
### string转float
float,_ = strconv.ParseFloat(string,64)
### stringbool
bool,_ = strconv.ParseBool(string)
### int转成stringstring := strconv.Itoa(int)
### int64转成stringstring := strconv.FormatInt(int64,10)
### float转int
i, _ := strconv.Atoi(fmt.Sprintf("%1.0f", v["status"]))

你可能感兴趣的:(Go,golang,开发语言)