This commit is contained in:
aozhiwei 2024-08-06 22:28:19 +08:00
parent 7078a16983
commit 489449c65d

View File

@ -37,20 +37,52 @@ func StrToSimpleReflectValue(val string, kind reflect.Kind) *reflect.Value {
v := reflect.ValueOf(val == "1" || val == "true")
return &v
}
case reflect.Int,
reflect.Int8,
reflect.Int16,
reflect.Int32,
reflect.Int64:
case reflect.Int:
{
v := reflect.ValueOf(int(ToInt64(val)))
return &v
}
case reflect.Int8:
{
v := reflect.ValueOf(int8(ToInt64(val)))
return &v
}
case reflect.Int16:
{
v := reflect.ValueOf(int16(ToInt64(val)))
return &v
}
case reflect.Int32:
{
v := reflect.ValueOf(int32(ToInt64(val)))
return &v
}
case reflect.Int64:
{
v := reflect.ValueOf(ToInt64(val))
return &v
}
case reflect.Uint,
reflect.Uint8,
reflect.Uint16,
reflect.Uint32,
reflect.Uint64:
case reflect.Uint:
{
v := reflect.ValueOf(uint(ToInt64(val)))
return &v
}
case reflect.Uint8:
{
v := reflect.ValueOf(uint8(ToInt64(val)))
return &v
}
case reflect.Uint16:
{
v := reflect.ValueOf(uint16(ToInt64(val)))
return &v
}
case reflect.Uint32:
{
v := reflect.ValueOf(uint32(ToInt64(val)))
return &v
}
case reflect.Uint64:
{
v := reflect.ValueOf(uint64(ToInt64(val)))
return &v