Skip to content

Commit

Permalink
fix: 修正错误信息提示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Sep 20, 2022
1 parent de423b8 commit 407525a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conv.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,13 @@ func toInt64(val any) (int64, error) {
if err == nil {
return int64(val), nil
}
return -1, typeError(val, "int64")
return -1, typeError(ret, "int64")
case string:
val, err := strconv.ParseFloat(ret, 64)
if err == nil {
return int64(val), nil
}
return -1, typeError(val, "int64")
return -1, typeError(ret, "int64")
default:
return -1, typeError(ret, "int64")
}
Expand Down Expand Up @@ -480,12 +480,12 @@ func toUint64(val any) (uint64, error) {
if val, err := strconv.ParseFloat(string(ret), 64); err == nil {
return uint64(val), nil
}
return 0, typeError(val, "uint64")
return 0, typeError(ret, "uint64")
case string:
if val, err := strconv.ParseFloat(ret, 64); err == nil {
return uint64(val), nil
}
return 0, typeError(val, "uint64")
return 0, typeError(ret, "uint64")
default:
return 0, typeError(ret, "uint64")
}
Expand Down

0 comments on commit 407525a

Please sign in to comment.