mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
fix attempt#1: int64 not assignable to int
This commit is contained in:
parent
21b67e97af
commit
99746bad8e
1 changed files with 2 additions and 2 deletions
|
@ -293,7 +293,7 @@ func ConvertString(src string, dst reflect.Value) (convertible bool, convErr E.N
|
|||
convErr = E.Invalid("int", src)
|
||||
return
|
||||
}
|
||||
dst.Set(reflect.ValueOf(i))
|
||||
dst.Set(reflect.ValueOf(i).Convert(dst.Type()))
|
||||
return
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
|
||||
i, err := strconv.ParseUint(src, 10, 64)
|
||||
|
@ -301,7 +301,7 @@ func ConvertString(src string, dst reflect.Value) (convertible bool, convErr E.N
|
|||
convErr = E.Invalid("uint", src)
|
||||
return
|
||||
}
|
||||
dst.Set(reflect.ValueOf(i))
|
||||
dst.Set(reflect.ValueOf(i).Convert(dst.Type()))
|
||||
return
|
||||
}
|
||||
// yaml like
|
||||
|
|
Loading…
Add table
Reference in a new issue