Skip to content
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

Make Cond Matcher generic #183

Merged
merged 2 commits into from
Jul 1, 2024
Merged

Make Cond Matcher generic #183

merged 2 commits into from
Jul 1, 2024

Conversation

fasmat
Copy link
Contributor

@fasmat fasmat commented Jun 13, 2024

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
Copy link

CLAassistant commented Jun 13, 2024

CLA assistant check
All committers have signed the CLA.

@fasmat fasmat changed the title Add generic Cond Matcher Make Cond Matcher generic Jun 13, 2024
@fasmat
Copy link
Contributor Author

fasmat commented Jun 27, 2024

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

@fasmat
Copy link
Contributor Author

fasmat commented Jun 28, 2024

or maybe @JacobOaks ?

Copy link
Contributor

@r-hang r-hang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Thanks for the contribution.

@r-hang r-hang merged commit 5021857 into uber-go:main Jul 1, 2024
3 checks passed
@fasmat fasmat deleted the typed-cond branch July 1, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants