mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
generated DeepCopy without a function on a struct pointer is wrong
in and out are both pointers to pointers, so *in has to be cast to *Type, not Type.
This commit is contained in:
parent
2ead4ba589
commit
13adc63bff
@ -609,7 +609,7 @@ func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) {
|
||||
sw.Do("if newVal, err := c.DeepCopy(*in); err != nil {\n", nil)
|
||||
sw.Do("return err\n", nil)
|
||||
sw.Do("} else {\n", nil)
|
||||
sw.Do("*out = newVal.($.|raw$)\n", t.Elem)
|
||||
sw.Do("*out = newVal.(*$.|raw$)\n", t.Elem)
|
||||
sw.Do("}\n", nil)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user