-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated import path contain "vendor" on Windows #203
Comments
Hey, thanks for sending in the issue. Please submit a PR and we can get this merged. |
@LandonTClipp - Is this issue still valid? If so, can you leave it open so others that experience it can see it is a known issue instead of closing it asking for PR? |
Yeah that's fine we can keep this open, sorry just trying to clear historic issues that may no longer be valid. |
Hi, v1 is not supported anymore, closing this ticket. Please open a separate ticket if you still experience this issue. Thanks! |
- Add benchmark test for registry.New
- Add benchmark test for registry.New
- Add benchmark test for registry.New
latest mockery tool generated mock go file wrongly on Windows OS.
The import path shall contain "vendor" folder and cause test phase build error.
For example:
import bolt "github.com/welemon/vendor/github.com/boltdb/bolt"
lead to build error
mocks\db.go:4:8: must be imported as github.com/boltdb/bolt
This issue does not exist on Mac / Linux.
After quick check, I think the issue is because of "generator.go" line 180
directories := strings.Split(path, string(filepath.Separator))
The function is intended to remove the "vendor" and fix the import path.
But
path
var could already contains only slash ('/'), not backslack('\') on Windows.Using
filepath.Separator
here will cause thepath
not tokenize correctly.This also explain why only happen on Windows.
I tested with changing the
filepath.Separator
to slash, will fix the generated mock file.Please fix this issue so that mockery can work on Windows properly? Thanks.
The text was updated successfully, but these errors were encountered: