mirror of
https://github.com/kubernetes/client-go.git
synced 2025-10-27 19:38:49 +00:00
Automatic merge from submit-queue Use json-iterator instead of ugorji for JSON. @smarterclayton @wojtek-t Fixes #36120 xref #18762 ```release-note Switch JSON marshal/unmarshal to json-iterator library. Performance should be close to previous with no generated code. ``` Kubernetes-commit: 6a845c67f097cd76f9d90ab3c9c5b5603c70afe4
16 lines
269 B
Go
16 lines
269 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
|
|
}
|