mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
kubectl: simplify deepcopy calls
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user