sanposhiho / gomockhandler

Mr. gomockhandler is the clever and more agile manager of golang/mock (uber/mock) 👔
MIT License
105 stars 8 forks source link

Eliminate the need to install mockgen #82

Open sanposhiho opened 2 years ago

sanposhiho commented 2 years ago

Let's eliminate the need to install mockgen.


We currently require users to install it. But, unexpected behaviors may occur due to differences in mockgen behavior depending on which mockgen the user has installed. Ideally, we should generate mocks without using user-installed mockgen and we can achieve that if we can import mockgen.


But currently, almost all logic of mockgen cannot be imported, because it is placed in main package. So, I propose to fork golang/mock, add changes to make it importable, and use the fork to import mockgen.

And, I raised the issue for golang/mock. https://github.com/golang/mock/issues/609

sanposhiho commented 2 years ago

We don't need to increment the major version for this change. The mode of using user's mockgen is necessary (because some users may want to use a specific version of mockgen.) and will not be removed, so it is backward compatible.