Open chatrasen opened 4 years ago
Hi @chatrasen, while personally I'm not the biggest fan of mocks (I prefer fakes and stubs), I understand that many Go programmers would love to have this feature. I also see that goland/mock is very popular.
I will approve a PR introducing this feature, as long as it is disabled by default, and enabled by a flag like --automock='mock'
, so that we can extend this to use other mocking libraries in the future.
I'm using mockery and are very interested in trying this package out! It would be amazing to get some generated code with support for mockery mocks as well 🙏
Following with great interest
Majority of the functions involve calls to functions from external packages which need to be mocked. Adding support for mocks can take
gotests
to the next level I believe.e.g. An example function and its generated test can look something like this (pseudocode)
CODE
TEST
I would first like to ask whether you have already thought about the feasibility of this idea. If you feel this is possible, I would love to work on this enhancement.