mirror of https://github.com/spf13/cast.git
Fix uint, uint8, uint16, uint32 and uint64 conversion in ToStringE function.
This commit is contained in:
parent
c01685bb84
commit
1ffadf5510
10
caste.go
10
caste.go
|
@ -819,15 +819,15 @@ func ToStringE(i interface{}) (string, error) {
|
||||||
case int8:
|
case int8:
|
||||||
return strconv.FormatInt(int64(s), 10), nil
|
return strconv.FormatInt(int64(s), 10), nil
|
||||||
case uint:
|
case uint:
|
||||||
return strconv.FormatInt(int64(s), 10), nil
|
return strconv.FormatUint(uint64(s), 10), nil
|
||||||
case uint64:
|
case uint64:
|
||||||
return strconv.FormatInt(int64(s), 10), nil
|
return strconv.FormatUint(uint64(s), 10), nil
|
||||||
case uint32:
|
case uint32:
|
||||||
return strconv.FormatInt(int64(s), 10), nil
|
return strconv.FormatUint(uint64(s), 10), nil
|
||||||
case uint16:
|
case uint16:
|
||||||
return strconv.FormatInt(int64(s), 10), nil
|
return strconv.FormatUint(uint64(s), 10), nil
|
||||||
case uint8:
|
case uint8:
|
||||||
return strconv.FormatInt(int64(s), 10), nil
|
return strconv.FormatUint(uint64(s), 10), nil
|
||||||
case []byte:
|
case []byte:
|
||||||
return string(s), nil
|
return string(s), nil
|
||||||
case template.HTML:
|
case template.HTML:
|
||||||
|
|
Loading…
Reference in New Issue