mirror of
https://github.com/json-iterator/go.git
synced 2025-02-01 19:14:29 +02:00
15 lines
268 B
Go
15 lines
268 B
Go
|
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
|
||
|
}
|