mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
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:
@@ -30,12 +30,12 @@ import (
|
||||
type testDecodable struct {
|
||||
Other string
|
||||
Value int `json:"value"`
|
||||
gvk *unversioned.GroupVersionKind
|
||||
gvk unversioned.GroupVersionKind
|
||||
}
|
||||
|
||||
func (d *testDecodable) GetObjectKind() unversioned.ObjectKind { return d }
|
||||
func (d *testDecodable) SetGroupVersionKind(gvk *unversioned.GroupVersionKind) { d.gvk = gvk }
|
||||
func (d *testDecodable) GroupVersionKind() *unversioned.GroupVersionKind { return d.gvk }
|
||||
func (d *testDecodable) GetObjectKind() unversioned.ObjectKind { return d }
|
||||
func (d *testDecodable) SetGroupVersionKind(gvk unversioned.GroupVersionKind) { d.gvk = gvk }
|
||||
func (d *testDecodable) GroupVersionKind() unversioned.GroupVersionKind { return d.gvk }
|
||||
|
||||
func TestDecode(t *testing.T) {
|
||||
gvk1 := &unversioned.GroupVersionKind{Kind: "Test", Group: "other", Version: "blah"}
|
||||
|
||||
Reference in New Issue
Block a user