diff options
Diffstat (limited to 'vendor/github.com/json-iterator/go/feature_json_number.go')
-rw-r--r-- | vendor/github.com/json-iterator/go/feature_json_number.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/json-iterator/go/feature_json_number.go b/vendor/github.com/json-iterator/go/feature_json_number.go new file mode 100644 index 000000000..0439f6725 --- /dev/null +++ b/vendor/github.com/json-iterator/go/feature_json_number.go @@ -0,0 +1,15 @@ +package jsoniter + +import "encoding/json" + +type Number string + +func CastJsonNumber(val interface{}) (string, bool) { + switch typedVal := val.(type) { + case json.Number: + return string(typedVal), true + case Number: + return string(typedVal), true + } + return "", false +} |