Skip to content

Commit

Permalink
fix vendor imports
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Nov 15, 2017
1 parent 5fbb656 commit b81056f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/mocker/mocker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b81056f

Please sign in to comment.