mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-08 18:39:16 +00:00
Fix: null jsonpath serialization
Signed-off-by: acejilam <acejilam@gmail.com> Kubernetes-commit: 9646ae5a9efb0eee7ac15577d113699700233017
This commit is contained in:
committed by
Kubernetes Publisher
parent
9c6b659a97
commit
a8fc969a34
@@ -573,6 +573,9 @@ func (j *JSONPath) evalToText(v reflect.Value) ([]byte, error) {
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("can't print type %s", v.Type())
|
||||
}
|
||||
if iface == nil {
|
||||
return []byte("null"), nil
|
||||
}
|
||||
var buffer bytes.Buffer
|
||||
fmt.Fprint(&buffer, iface)
|
||||
return buffer.Bytes(), nil
|
||||
|
Reference in New Issue
Block a user