-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
unnecessary type arguments infertypeargs #5488
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
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
The type inference exists since the introduction of generics (go1.18), it is not related to go1.24 or a new element. But I will try to see if I can implement an analyzer of the topic. Note: there is a GitHub bug with converting an issue to discussion: https://github.com/orgs/community/discussions/152627 |
Ok, you are referring to a gopls analyzer. |
Welcome
How did you install golangci-lint?
go install
Your feature request related to a problem? Please describe
Hello,
After upgrading to Go version
1.24.0
, we noticed that the generic type parameters no longer need to be explicitly specified as they can be inferred automatically.Previously, the code would be written as follows:
Now, it can be written as:
Official reference: link
If the old style is still used, the editor already provides a hint:
unnecessary type arguments infertypeargs
.However, running
golangci-lint run
currently does not detect this issue. We would appreciate it if this functionality could be added.golangci-lint:
v1.64.5
Thank you very much.
Describe the solution you'd like
We hope that
golangci-lint run
will provide a warning for the issueunnecessary type arguments infertypeargs
.Describe alternatives you've considered
I apologize for my lack of expertise in this area. I can only raise the issue and currently do not have the capability to solve it.
Additional context
No response
Supporter
The text was updated successfully, but these errors were encountered: