-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
enhancementNew feature or improvementNew feature or improvement
Description
Welcome
- Yes, I've searched similar issues on GitHub and didn't find any.
- I agree to follow this project's Code of Conduct
How did you install golangci-lint?
Official binary
Your feature request related to a problem? Please describe
Go supports initializing structs without naming fields in which case it maps values to fields in field-definition order:
type S struct {
A string
B string
}
It allows creating an instance of the struct by doing S{"a", "b"} instead of S{A: "a", B: "b"}.
Describe the solution you'd like
I think initializing structs without naming fields is fragile and I would like to request a linter which would complain about it (and potentially autofix by adding fields).
Describe alternatives you've considered
Code style for our projects could require developers not to use short style, but it is best if a linter can check for that.
Additional context
No response
Supporter
- I am a sponsor through thanks.dev
Metadata
Metadata
Assignees
Labels
enhancementNew feature or improvementNew feature or improvement