-
Notifications
You must be signed in to change notification settings - Fork 607
mockgen source mode does not work with go1.11 modules #230
Comments
Any news on this? Also a problem for me exactly as described. Thx |
@poy I'm getting exactly same results as @arjantop go/bin » shasum mockgen
ee87abd95d7ff07a7d43847b1fefb45b174ad814 mockgen
|
The same problem here as well. I've bypassed it by running the following after creating the mocks:
|
@poy https://github.com/arjantop/golang_gomock_bug I see the same problem on v1.2.0 |
Can I get |
Version: Env:
|
Perfect thanks. The difference was I was leaving the code inside the GOPATH. Once I moved it out of the GOPATH the problem presented itself. |
@arjantop (any anyone else) could you please try the branch |
@poy instead of
|
@davidkuridza I believe this implies you need to use the |
It also appears that this won't work with anything before go 1.10. Therefore we'll have to wait until 1.12 is released before we can release this. |
@poy it works correctly with |
@poy everything works like a charm, thank you. |
@poy Can't seem to find the branch with the fix. Any other work being done on this? |
@Helvind I'm not sure how the branch disappeared. I've pushed it back up. There is some an incompatibility with go1.9. As we support the last 3 versions of Go, we are waiting for 1.12 to come out. |
could you please put the example of using the flag? |
Go 1.12 is released today, any chance this fix will be merged soon? We'd love to get rid of the "replace" flag (which broke a few days ago when you rebased because the commit hash changed) in our project. Thanks for all your work! |
@murilobsd something like this
|
@david-l-riley I think we need to get #268 merged first. Then hopefully our CI pipelines go green for #253 |
The new
|
@david-l-riley OK thanks! I'll try something different. |
@david-l-riley I pushed a fix. |
OK, I'm going to fork for now because every time changes are rebased onto the branch (instead of merge committed), the commit disappears, and since |
@david-l-riley Sorry about that. Its the problem with force pushing. I'm only doing so as I'm on a branch. Knowing you all are pulling from this branch, I'll stop doing this and ensure we squash before merging it into master. Thanks for sticking with it! |
No, keep it up! I just forked, it's actually what I should have done in the first place. :-) Thanks again for all your work on it. |
Any progress on this? I'm running into this specific issue when mocking GRPC clients. |
@losttrekker Sorry, #253 is still pending a review. |
It works correctly what converts |
Awesome, thanks so much for your work on this! |
I still can't get this working with modules, I tried replicating what @davidkuridza commented here but now the generated code simply doesn't import the package under mock, resulting in undefined symbol errors (due to the symbols not being namespaced properly). Is there an accepted solution / documentation anywhere for this problem? |
"self" import is generates as
x "."
. It works in gopath and with reflection basedmockgen
.Using
-self_package
does not affect the output.Sample program (foo.go):
Used command:
$ mockgen -source=foo.go
Generated output:
Versions:
go version go1.11.2 darwin/amd64
mockgen latest version
The text was updated successfully, but these errors were encountered: