From 407525aa2a60f53e97ec13a1ae6c1775c5ce4552 Mon Sep 17 00:00:00 2001 From: caixw Date: Tue, 20 Sep 2022 17:44:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conv.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conv.go b/conv.go index 1162c77..227657e 100644 --- a/conv.go +++ b/conv.go @@ -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") } @@ -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") }