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}} `