Use inline assignment on string alias deep copies

pull/6/head
Clayton Coleman 2016-06-06 16:13:48 -04:00
parent 0181ac61da
commit 460726c67d
No known key found for this signature in database
GPG Key ID: 3D16906B4F1C5CB3
1 changed files with 1 additions and 1 deletions

View File

@ -459,7 +459,7 @@ func (g *genDeepCopy) doInterface(t *types.Type, sw *generator.SnippetWriter) {
func (g *genDeepCopy) doPointer(t *types.Type, sw *generator.SnippetWriter) {
sw.Do("*out = new($.Elem|raw$)\n", t)
if t.Elem.Kind == types.Builtin {
if t.Elem.IsAssignable() {
sw.Do("**out = *in", nil)
} else if g.canInlineTypeFn(g.context, t.Elem) {
funcName := g.funcNameTmpl(t.Elem)