-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add interfaces flag with unit test #200
base: main
Are you sure you want to change the base?
Conversation
59bd1d7
to
2553835
Compare
Hey @JacobOaks , can you please take a look? |
Hey @kliukovkin! Thanks for the PR! I am in favor of having this feature, just two questions/comments:
|
- Instead of using an -interfaces flag, what do you think about having source mode read positional arguments (i.e., mockgen -source <path/to/file.go> InterfaceOne,InterfaceTwo) to align it with how reflect mode works? (If there are no positional arguments specified, we would parse all interfaces to keep backwards compatibility) - Instead of parsing and then dropping interfaces that aren't specified, can we simply not parse ones that aren't requested? This is similar to how the exclusion flag already works and would avoid some wasted computation.
Hey @JacobOaks ! Done, can you please review and let me know if that looks good? |
This is a proposal for
-interfaces
flag using source mode. Using this flag it is possible to list only required interfaces to be mocked in source mode. Currently, source mode mocks all interfaces which -source file contains.Thanks @KastenMike for raising this!
Fixes golang/mock#660