ing
This commit is contained in:
parent
2f57a0975f
commit
2049abfd2f
1
encoding/json/json.go
Normal file
1
encoding/json/json.go
Normal file
|
@ -0,0 +1 @@
|
|||
package json
|
11
encoding/json/number.go
Normal file
11
encoding/json/number.go
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user