kubectl: simplify deepcopy calls

This commit is contained in:
Dr. Stefan Schimanski
2017-08-15 14:13:20 +02:00
parent 1d633b7fdd
commit c0dbe9a900
9 changed files with 40 additions and 39 deletions

View File

@@ -26,7 +26,9 @@ import (
reflect "reflect"
)
// Deprecated: GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.
// GetGeneratedDeepCopyFuncs returns the generated funcs, since we aren't registering them.
//
// Deprecated: deepcopy registration will go away when static deepcopy is fully implemented.
func GetGeneratedDeepCopyFuncs() []conversion.GeneratedDeepCopyFunc {
return []conversion.GeneratedDeepCopyFunc{
{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error {
@@ -61,19 +63,19 @@ func (in *TestStruct) DeepCopyInto(out *TestStruct) {
return
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, creating a new TestStruct.
func (x *TestStruct) DeepCopy() *TestStruct {
if x == nil {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TestStruct.
func (in *TestStruct) DeepCopy() *TestStruct {
if in == nil {
return nil
}
out := new(TestStruct)
x.DeepCopyInto(out)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (x *TestStruct) DeepCopyObject() runtime.Object {
if c := x.DeepCopy(); c != nil {
func (in *TestStruct) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
} else {
return nil