matryer / moq

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

Moq fails generating mocks in go 1.18 #166

Closed tprebs closed 2 years ago

tprebs commented 2 years ago

I switch from go version 1.17.8 to 1.18 and now Moq is now failing with internal error: package "errors" without types was imported from "....". After a quick dig around its seems to be caused by the current version of x/tools not playing nicely with 1.18. (https://github.com/golang/go/issues/49164)

I have bumped xtools to 0.1.9 and this has resolved the issue

jozuenoon commented 2 years ago

Same here, hope we get a new release soon?

peterhellberg commented 2 years ago

I've resorted to git clone --single-branch -b update_x_tools https://github.com/slagiewka/moq.git && cd moq && go install in our Dockerfile that is used when calling go generate.

matryer commented 2 years ago

Please try the latest release, and let me know.

peterhellberg commented 2 years ago

@matryer I've updated our Dockerfile, and the new release seems to be working as it should. 👍🏻