Change ObjectKind signature to avoid allocations

We don't need to pass a pointer into SetGroupKindVersion() - a
struct works just as well.
This commit is contained in:
Clayton Coleman
2016-04-30 20:34:40 -04:00
parent bffbc112f0
commit a84e62d9e6
22 changed files with 109 additions and 143 deletions

View File

@@ -45,10 +45,10 @@ func (s unstructuredJSONScheme) Decode(data []byte, _ *unversioned.GroupVersionK
gvk := obj.GetObjectKind().GroupVersionKind()
if len(gvk.Kind) == 0 {
return nil, gvk, NewMissingKindErr(string(data))
return nil, &gvk, NewMissingKindErr(string(data))
}
return obj, gvk, nil
return obj, &gvk, nil
}
func (unstructuredJSONScheme) EncodeToStream(obj Object, w io.Writer, overrides ...unversioned.GroupVersion) error {