uber-go / mock

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

Make Cond Matcher generic #183

Closed fasmat closed 3 days ago

fasmat commented 3 weeks ago

gomock.Cond at the moment expects an matcher function with the signature func(x any) bool requiring a manual cast to the expected type. By making this matcher generic the callback function can be typed removing the need for a manual cast to the expected type.

The change should be backwards compatible with existing tests using gomock.Cond.

CLAassistant commented 3 weeks ago

CLA assistant check
All committers have signed the CLA.

fasmat commented 1 week ago

Any feedback on this? @r-hang or @sywhang 🙂

fasmat commented 6 days ago

or maybe @JacobOaks ?