From 25c5fc583cefc5c7e70fc517f469d21dca80ca05 Mon Sep 17 00:00:00 2001 From: Alex Kohler Date: Wed, 5 Dec 2018 13:39:17 -0500 Subject: [PATCH] Don't include package name if TargetName == DestinationPackage --- generator/interface_template.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/generator/interface_template.go b/generator/interface_template.go index 47c7125..75f1a94 100644 --- a/generator/interface_template.go +++ b/generator/interface_template.go @@ -162,6 +162,10 @@ func (fake *{{.Name}}) recordInvocation(key string, args []interface{}) { } {{if IsExported .TargetName -}} +{{- if eq .TargetAlias .DestinationPackage }} +var _ {{.TargetName}} = new({{.Name}}) +{{- else }} var _ {{.TargetAlias}}.{{.TargetName}} = new({{.Name}}) {{- end}} +{{- end}} `