github.com/galaxyobe/gen@v0.0.0-20220910125335-392fa8f0990f/cmd/deepcopy-gen/output_tests/slices/deepcopy_generated.go (about)

     1  //go:build !ignore_autogenerated
     2  // +build !ignore_autogenerated
     3  
     4  /*
     5  Copyright The Kubernetes Authors.
     6  
     7  Licensed under the Apache License, Version 2.0 (the "License");
     8  you may not use this file except in compliance with the License.
     9  You may obtain a copy of the License at
    10  
    11      http://www.apache.org/licenses/LICENSE-2.0
    12  
    13  Unless required by applicable law or agreed to in writing, software
    14  distributed under the License is distributed on an "AS IS" BASIS,
    15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    16  See the License for the specific language governing permissions and
    17  limitations under the License.
    18  */
    19  
    20  // Code generated by ___deepcopy_gen. DO NOT EDIT.
    21  
    22  package slices
    23  
    24  // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
    25  func (in *Ttest) DeepCopyInto(out *Ttest) {
    26  	*out = *in
    27  	if in.Byte != nil {
    28  		in, out := &in.Byte, &out.Byte
    29  		*out = make([]byte, len(*in))
    30  		copy(*out, *in)
    31  	}
    32  	if in.Int16 != nil {
    33  		in, out := &in.Int16, &out.Int16
    34  		*out = make([]int16, len(*in))
    35  		copy(*out, *in)
    36  	}
    37  	if in.Int32 != nil {
    38  		in, out := &in.Int32, &out.Int32
    39  		*out = make([]int32, len(*in))
    40  		copy(*out, *in)
    41  	}
    42  	if in.Int64 != nil {
    43  		in, out := &in.Int64, &out.Int64
    44  		*out = make([]int64, len(*in))
    45  		copy(*out, *in)
    46  	}
    47  	if in.Uint8 != nil {
    48  		in, out := &in.Uint8, &out.Uint8
    49  		*out = make([]byte, len(*in))
    50  		copy(*out, *in)
    51  	}
    52  	if in.Uint16 != nil {
    53  		in, out := &in.Uint16, &out.Uint16
    54  		*out = make([]uint16, len(*in))
    55  		copy(*out, *in)
    56  	}
    57  	if in.Uint32 != nil {
    58  		in, out := &in.Uint32, &out.Uint32
    59  		*out = make([]uint32, len(*in))
    60  		copy(*out, *in)
    61  	}
    62  	if in.Uint64 != nil {
    63  		in, out := &in.Uint64, &out.Uint64
    64  		*out = make([]uint64, len(*in))
    65  		copy(*out, *in)
    66  	}
    67  	if in.Float32 != nil {
    68  		in, out := &in.Float32, &out.Float32
    69  		*out = make([]float32, len(*in))
    70  		copy(*out, *in)
    71  	}
    72  	if in.Float64 != nil {
    73  		in, out := &in.Float64, &out.Float64
    74  		*out = make([]float64, len(*in))
    75  		copy(*out, *in)
    76  	}
    77  	if in.String != nil {
    78  		in, out := &in.String, &out.String
    79  		*out = make([]string, len(*in))
    80  		copy(*out, *in)
    81  	}
    82  	if in.StringPtr != nil {
    83  		in, out := &in.StringPtr, &out.StringPtr
    84  		*out = make([]*string, len(*in))
    85  		for i := range *in {
    86  			if (*in)[i] != nil {
    87  				in, out := &(*in)[i], &(*out)[i]
    88  				*out = new(string)
    89  				**out = **in
    90  			}
    91  		}
    92  	}
    93  	if in.StringPtrPtr != nil {
    94  		in, out := &in.StringPtrPtr, &out.StringPtrPtr
    95  		*out = make([]**string, len(*in))
    96  		for i := range *in {
    97  			if (*in)[i] != nil {
    98  				in, out := &(*in)[i], &(*out)[i]
    99  				*out = new(*string)
   100  				if **in != nil {
   101  					in, out := *in, *out
   102  					*out = new(string)
   103  					**out = **in
   104  				}
   105  			}
   106  		}
   107  	}
   108  	if in.Map != nil {
   109  		in, out := &in.Map, &out.Map
   110  		*out = make([]map[string]string, len(*in))
   111  		for i := range *in {
   112  			if (*in)[i] != nil {
   113  				in, out := &(*in)[i], &(*out)[i]
   114  				*out = make(map[string]string, len(*in))
   115  				for key, val := range *in {
   116  					(*out)[key] = val
   117  				}
   118  			}
   119  		}
   120  	}
   121  	if in.MapPtr != nil {
   122  		in, out := &in.MapPtr, &out.MapPtr
   123  		*out = make([]*map[string]string, len(*in))
   124  		for i := range *in {
   125  			if (*in)[i] != nil {
   126  				in, out := &(*in)[i], &(*out)[i]
   127  				*out = new(map[string]string)
   128  				if **in != nil {
   129  					in, out := *in, *out
   130  					*out = make(map[string]string, len(*in))
   131  					for key, val := range *in {
   132  						(*out)[key] = val
   133  					}
   134  				}
   135  			}
   136  		}
   137  	}
   138  	if in.Slice != nil {
   139  		in, out := &in.Slice, &out.Slice
   140  		*out = make([][]string, len(*in))
   141  		for i := range *in {
   142  			if (*in)[i] != nil {
   143  				in, out := &(*in)[i], &(*out)[i]
   144  				*out = make([]string, len(*in))
   145  				copy(*out, *in)
   146  			}
   147  		}
   148  	}
   149  	if in.SlicePtr != nil {
   150  		in, out := &in.SlicePtr, &out.SlicePtr
   151  		*out = make([]*[]string, len(*in))
   152  		for i := range *in {
   153  			if (*in)[i] != nil {
   154  				in, out := &(*in)[i], &(*out)[i]
   155  				*out = new([]string)
   156  				if **in != nil {
   157  					in, out := *in, *out
   158  					*out = make([]string, len(*in))
   159  					copy(*out, *in)
   160  				}
   161  			}
   162  		}
   163  	}
   164  	if in.Struct != nil {
   165  		in, out := &in.Struct, &out.Struct
   166  		*out = make([]Ttest, len(*in))
   167  		for i := range *in {
   168  			(*in)[i].DeepCopyInto(&(*out)[i])
   169  		}
   170  	}
   171  	if in.StructPtr != nil {
   172  		in, out := &in.StructPtr, &out.StructPtr
   173  		*out = make([]*Ttest, len(*in))
   174  		for i := range *in {
   175  			if (*in)[i] != nil {
   176  				in, out := &(*in)[i], &(*out)[i]
   177  				*out = new(Ttest)
   178  				(*in).DeepCopyInto(*out)
   179  			}
   180  		}
   181  	}
   182  	return
   183  }
   184  
   185  // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ttest.
   186  func (in *Ttest) DeepCopy() *Ttest {
   187  	if in == nil {
   188  		return nil
   189  	}
   190  	out := new(Ttest)
   191  	in.DeepCopyInto(out)
   192  	return out
   193  }