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.
Maybe we can use ... instead of slice?
func OneOf(x any...) Matcher
|
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
gomockfor 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!