GoLang中前端提交的数据 map[string]interface{}
转对应的类型方法。
比如前端提交的字符串要转成数字,但可能是字符串提交也可能是int提交。
var value interface{}
var id int
switch vt := value.(type) {
case string:
id , _ = strconv.Atoi(vt)
case float64:
id = int(vt)
case float33:
id = int(vt)