1 反射
val := reflect.ValueOf(v)
kind := val.Kind()
if kind == reflect.String {
pValue := val.String()
} else if kind == reflect.Int ||
kind == reflect.Int8 ||
kind == reflect.Int16 ||
kind == reflect.Int32 ||
kind == reflect.Int64 {
pValueInt := val.Int()
pValue := strconv.FormatInt(pValueInt, 10)
} else if kind == reflect.Float32 ||
kind == reflect.Float64 {
pValueFloat := val.Float()
pValue := strconv.FormatFloat(pValueFloat, 'f', -1, 64)
} else if kind == reflect.Slice {
vSlice, ok := v.([]interface{})
if ok {
}
} else if kind == reflect.Map {
vMap, ok := v.(map[string]interface{})
if ok {
}
}