-
Notifications
You must be signed in to change notification settings - Fork 116
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
proposal: Add OneOf
Matcher
#91
Conversation
// | ||
// OneOf([]any{100,200,300}) | ||
// OneOf([]any{"Go", "Gopher"}) | ||
func OneOf(x []any) Matcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can use ...
instead of slice?
func OneOf(x any...) Matcher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I believe this PR is largely subsumed by my PR #63, modulo the difference in the interface (the name |
I want to add that this feature has been discussed many times, even before the transfer to Uber. Here were some related discussions (including the one after the transfer):
I hope that the PR #63 (or at least this PR) can be merged soon. 😀 |
As an update here, I've already approved and plan to merge #63 (review) to address this issue. |
@abshierjoel, given #63 is it okay if we close this issue? |
Closing now that #63 has landed. |
This is one potential implementation of proposal #90
This proposal introduces a new Matcher to
gomock
for matching a parameter against is list of potential values it may have. This should help ease-of-use, when multiple matches are necessary and additionally help navigate around an existing issue with overriding matches.I would appreciate any and all feedback on this proposal! Thank you!