Closed abshierjoel closed 9 months ago
Hi, I believe this PR is largely subsumed by my PR #63, modulo the difference in the interface (the name OneOf
versus AnyOf
and whether it is taking a slice versus a variable number of arguments). The difference seems minor because one can write AnyOf(choices..)
for a slice choices
. On the other hand, the AnyOf
in #63 can also take matchers such as Len(100)
, which I believe is more powerful than the OneOf
in this PR.
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 https://github.com/uber-go/mock/pull/63#pullrequestreview-1631937634 to address this issue.
@abshierjoel, given https://github.com/uber-go/mock/pull/63 is it okay if we close this issue?
Closing now that https://github.com/uber-go/mock/pull/63 has landed.
@r-hang apologies for the slow response on this. Thanks for feedback @Tulzke and @favonia -- I really appreciate it! Glad we'll got something better with #63!
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!