Skip to content

Commit b81056f

Browse files
committed
fix vendor imports
1 parent 5fbb656 commit b81056f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/mocker/mocker.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,14 @@ func (m *mocker) params(sig *types.Signature, tuple *types.Tuple, format string)
183183
return ""
184184
}
185185
path := pkg.Path()
186+
wd, err := os.Getwd()
187+
if err != nil {
188+
return ""
189+
}
186190
if path == "." {
187-
wd, err := os.Getwd()
188-
if err != nil {
189-
return ""
190-
}
191191
path = strings.TrimPrefix(wd, os.Getenv("GOPATH")+"/src/")
192+
} else {
193+
path = strings.TrimPrefix(path, strings.TrimPrefix(wd, os.Getenv("GOPATH")+"/src/")+"/vendor/")
192194
}
193195
m.imports[path] = true
194196
return pkg.Name()

0 commit comments

Comments
 (0)