github.com/galaxyobe/gen@v0.0.0-20220910125335-392fa8f0990f/examples/deepcopy-gen/pointer/deepcopy_generated.go (about)

     1  //go:build !ignore_autogenerated
     2  // +build !ignore_autogenerated
     3  
     4  /*
     5  Copyright The Gen 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 pointer
    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.Builtin != nil {
    28  		in, out := &in.Builtin, &out.Builtin
    29  		*out = new(string)
    30  		**out = **in
    31  	}
    32  	if in.Ptr != nil {
    33  		in, out := &in.Ptr, &out.Ptr
    34  		*out = new(*string)
    35  		if **in != nil {
    36  			in, out := *in, *out
    37  			*out = new(string)
    38  			**out = **in
    39  		}
    40  	}
    41  	if in.Map != nil {
    42  		in, out := &in.Map, &out.Map
    43  		*out = new(map[string]string)
    44  		if **in != nil {
    45  			in, out := *in, *out
    46  			*out = make(map[string]string, len(*in))
    47  			for key, val := range *in {
    48  				(*out)[key] = val
    49  			}
    50  		}
    51  	}
    52  	if in.Slice != nil {
    53  		in, out := &in.Slice, &out.Slice
    54  		*out = new([]string)
    55  		if **in != nil {
    56  			in, out := *in, *out
    57  			*out = make([]string, len(*in))
    58  			copy(*out, *in)
    59  		}
    60  	}
    61  	if in.MapPtr != nil {
    62  		in, out := &in.MapPtr, &out.MapPtr
    63  		*out = new(*map[string]string)
    64  		if **in != nil {
    65  			in, out := *in, *out
    66  			*out = new(map[string]string)
    67  			if **in != nil {
    68  				in, out := *in, *out
    69  				*out = make(map[string]string, len(*in))
    70  				for key, val := range *in {
    71  					(*out)[key] = val
    72  				}
    73  			}
    74  		}
    75  	}
    76  	if in.SlicePtr != nil {
    77  		in, out := &in.SlicePtr, &out.SlicePtr
    78  		*out = new(*[]string)
    79  		if **in != nil {
    80  			in, out := *in, *out
    81  			*out = new([]string)
    82  			if **in != nil {
    83  				in, out := *in, *out
    84  				*out = make([]string, len(*in))
    85  				copy(*out, *in)
    86  			}
    87  		}
    88  	}
    89  	if in.Struct != nil {
    90  		in, out := &in.Struct, &out.Struct
    91  		*out = new(Ttest)
    92  		(*in).DeepCopyInto(*out)
    93  	}
    94  	if in.StructPtr != nil {
    95  		in, out := &in.StructPtr, &out.StructPtr
    96  		*out = new(*Ttest)
    97  		if **in != nil {
    98  			in, out := *in, *out
    99  			*out = new(Ttest)
   100  			(*in).DeepCopyInto(*out)
   101  		}
   102  	}
   103  	return
   104  }
   105  
   106  // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ttest.
   107  func (in *Ttest) DeepCopy() *Ttest {
   108  	if in == nil {
   109  		return nil
   110  	}
   111  	out := new(Ttest)
   112  	in.DeepCopyInto(out)
   113  	return out
   114  }