From 81c463c9b96c2edb0be1f6a462928a286b7379f9 Mon Sep 17 00:00:00 2001 From: Lucas Bremgartner Date: Tue, 22 Jan 2019 21:40:29 +0100 Subject: [PATCH] Add import, if source pkg is not destination pkg Fixes #86 --- pkg/moq/moq.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/moq/moq.go b/pkg/moq/moq.go index c2a27ee..dfd2ae9 100644 --- a/pkg/moq/moq.go +++ b/pkg/moq/moq.go @@ -174,6 +174,7 @@ func (m *Mocker) Mock(w io.Writer, name ...string) error { if tpkg.Name() != m.pkgName { doc.SourcePackagePrefix = tpkg.Name() + "." + doc.Imports = append(doc.Imports, tpkg.Path()) } var buf bytes.Buffer