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

new check: detect unnecessary gomock controller Finish call #1384

Open
hendrywiranto opened this issue Nov 21, 2023 · 1 comment
Open

new check: detect unnecessary gomock controller Finish call #1384

hendrywiranto opened this issue Nov 21, 2023 · 1 comment

Comments

@hendrywiranto
Copy link

Hello, does this linter support checking of a library usage too?
If yes, I would like to open a PR for this

Background

As highlighted in https://pkg.go.dev/github.com/golang/mock/gomock#NewController:

New in go1.14+, if you are passing a *testing.T into this function you no longer need to call ctrl.Finish() in your test methods.

New rule

A linting rule that can flag when we're unnecessarily calling .Finish to gomock controller, when using a Go version of 1.14+.

@cristaloleg
Copy link
Member

@quasilyte WDYT ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants