golang / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
9.28k stars 610 forks source link

feat: new in slice matcher #582

Closed MakDon closed 2 years ago

MakDon commented 3 years ago

This PR provides a new matcher that returns true if the given value Eq one of the want elements.

// Example usage:
m := In([]int{1,2})
m.Matches(1) // returns true
m.Matches(2) // returns true
m.Matches(3) // returns false
codyoss commented 2 years ago

@MakDon Can you please open up an issue for discussion about adding such a feature. Thanks.

MakDon commented 2 years ago

@codyoss Hi codyoss, thanks for your review.

I've opened up an issue #590 for further discussion.

codyoss commented 2 years ago

Closing this for now until discussion on the issue has settled. I will reopen if we decide to move forward with these changes.