sw.Do("func (in *$.type|raw$) DeepCopy() *$.type|raw$ {\n",args)
sw.Do("if x == nil { return nil }\n",nil)
sw.Do("if in == nil { return nil }\n",nil)
sw.Do("out := new($.type|raw$)\n",args)
sw.Do("out := new($.type|raw$)\n",args)
sw.Do("x.DeepCopyInto(out)\n",nil)
sw.Do("in.DeepCopyInto(out)\n",nil)
sw.Do("return out\n",nil)
sw.Do("return out\n",nil)
sw.Do("}\n\n",nil)
sw.Do("}\n\n",nil)
}
}
...
@@ -581,12 +584,12 @@ func (g *genDeepCopy) GenerateType(c *generator.Context, t *types.Type, w io.Wri
...
@@ -581,12 +584,12 @@ func (g *genDeepCopy) GenerateType(c *generator.Context, t *types.Type, w io.Wri
for_,intf:=rangeintfs{
for_,intf:=rangeintfs{
sw.Do(fmt.Sprintf("// DeepCopy%s is an autogenerated deepcopy function, copying the receiver, creating a new $.type2|raw$.\n",intf.Name.Name),argsFromType(t,intf))
sw.Do(fmt.Sprintf("// DeepCopy%s is an autogenerated deepcopy function, copying the receiver, creating a new $.type2|raw$.\n",intf.Name.Name),argsFromType(t,intf))