From b81056f49252570f3f77da7ba32e4d925c1022b8 Mon Sep 17 00:00:00 2001 From: Travis Jeffery Date: Wed, 15 Nov 2017 18:47:08 -0500 Subject: [PATCH] fix vendor imports --- pkg/mocker/mocker.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/mocker/mocker.go b/pkg/mocker/mocker.go index 6b7db24..f325c2f 100644 --- a/pkg/mocker/mocker.go +++ b/pkg/mocker/mocker.go @@ -183,12 +183,14 @@ func (m *mocker) params(sig *types.Signature, tuple *types.Tuple, format string) return "" } path := pkg.Path() + wd, err := os.Getwd() + if err != nil { + return "" + } if path == "." { - wd, err := os.Getwd() - if err != nil { - return "" - } path = strings.TrimPrefix(wd, os.Getenv("GOPATH")+"/src/") + } else { + path = strings.TrimPrefix(path, strings.TrimPrefix(wd, os.Getenv("GOPATH")+"/src/")+"/vendor/") } m.imports[path] = true return pkg.Name()