-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 linter: flag unnecessary calls to Finish
on gomock.Controller
s in Go 1.14+
#3223
Comments
Hello, FYI golangci-lint is a meta-linter, there are no internal linting rules. |
That's fair! Are you happy me leaving this here in case someone else wants to pick it up and contribute it? |
I flagged it as a linter idea, so yes we can keep it. |
Finish
on gomock.Controller
s in Go 1.14+Finish
on gomock.Controller
s in Go 1.14+
Hi can I try implementing a linter based on this idea? |
Yes please, happy for you to go for it ☺ |
Sorry for a bit of delay as I was busy with my uni work. I have finished the implementation part and I will do more testing to ensure that it really works. Once done with it, I will throw a PR. |
@daikidev111, how is it going? :) Pay attention that |
@Antonboom |
It has never been supported natively by Go, it was related to a library. The libraries inside the golang organization are not related to Go itself. |
Thank you for the clarification. I will resume working on this! |
Hi, look like the interested user still doesn't move forward with this so I created the linter here https://github.com/hendrywiranto/gomockcontrollerfinish |
For the workaround see #4202 (comment) |
@ldez maybe we should close this issue because it's possible to detect |
Your feature request related to a problem? Please describe.
As highlighted in https://pkg.go.dev/github.com/golang/mock/gomock#NewController:
Describe the solution you'd like.
A linting rule that can flag when we're unnecessarily calling
.Finish
, when using a Go version of 1.14+Describe alternatives you've considered.
N/A
Additional context.
No response
The text was updated successfully, but these errors were encountered: