This commit is contained in:
crusader 2017-12-04 17:59:56 +09:00
parent 2f57a0975f
commit 2049abfd2f
2 changed files with 12 additions and 0 deletions

1
encoding/json/json.go Normal file
View File

@ -0,0 +1 @@
package json

11
encoding/json/number.go Normal file
View File

@ -0,0 +1,11 @@
package json
import "encoding/json"
func NumberToInt(n json.Number) (int, error) {
n64, err := n.Int64()
if nil != err {
return 0, err
}
return int(n64), nil
}