matryer / moq

Interface mocking tool for go generate
http://bit.ly/meetmoq
MIT License
1.99k stars 126 forks source link

Broken with golang1.18 #169

Closed cgorenflo closed 2 years ago

cgorenflo commented 2 years ago

When running moq with golang 1.18 I get countless errors of the form

internal error: package "XXX" without types was imported from "YYY"

My generate pipeline works fine with golang 1.17.x. I also tried a fork of moq with the golang.org/x/tools dependency updated to HEAD (currently v0.1.11-0.20220322213029-87a8611856c1) and this also seems to fix the issue with golang 1.18.

While I would love for this to be fixed as soon as possible, I can understand if you don't want to include an untagged dependency.

peterhellberg commented 2 years ago

@cgorenflo Did you use the latest release of moq? (https://github.com/matryer/moq/releases/tag/v0.2.6)

cgorenflo commented 2 years ago

yes, golang.org/x/tools v0.1.10 doesn't solve the issue for me, I had to force the head commit for that dependency to make it work

cgorenflo commented 2 years ago

I did some more testing and it seems there was an issue with my system when I first tried it. I was able to run it now with v0.2.6. Sorry about the confusion!