bump(github.com/json-iterator/go): 13f86432b882000a51c6e610c620974462691a97

This commit is contained in:
Nikhita Raghunath
2017-12-13 15:11:17 +05:30
parent 38e3351312
commit 07bf6e8088
27 changed files with 628 additions and 157 deletions

View File

@@ -1,9 +1,25 @@
package jsoniter
import "encoding/json"
import (
"encoding/json"
"strconv"
)
type Number string
// String returns the literal text of the number.
func (n Number) String() string { return string(n) }
// Float64 returns the number as a float64.
func (n Number) Float64() (float64, error) {
return strconv.ParseFloat(string(n), 64)
}
// Int64 returns the number as an int64.
func (n Number) Int64() (int64, error) {
return strconv.ParseInt(string(n), 10, 64)
}
func CastJsonNumber(val interface{}) (string, bool) {
switch typedVal := val.(type) {
case json.Number: