From 6cdd0515a5f9f661c09aab6f171de9d9e6d9bdfb Mon Sep 17 00:00:00 2001 From: crusader Date: Mon, 4 Dec 2017 18:31:23 +0900 Subject: [PATCH] ing --- encoding/json/number.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/encoding/json/number.go b/encoding/json/number.go index 5cddf22..936ba86 100644 --- a/encoding/json/number.go +++ b/encoding/json/number.go @@ -1,9 +1,12 @@ package json -import "encoding/json" +import ( + "encoding/json" + "strconv" +) func NumberToInt(n json.Number) (int, error) { - n64, err := n.Int64() + n64, err := strconv.ParseInt(n.String(), 10, 32) if nil != err { return 0, err }