-
-
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
Deprecate maligned, add govet fieldalignment
as replacement
#1765
Conversation
@ldez please, what is correct way to fix message |
yes you just have to disable or remove linters:
disable:
- maligned
linters-settings:
govet:
enable:
- fieldalignment linters:
disable:
- maligned
linters-settings:
govet:
enable-all: true
|
@ldez ok, thanks, now it works and it writes a lot of warnings, e.g.: type RhAccount struct {
ID int
Name string
} What does it mean, please? I can not find any explanation anywhere. |
|
This is about "struct size" See explaination at golang/go#44877 (comment) #1825 is about making this second type of check non-default as per author intention indicated in comment above. (As it was the case with maligned used in golangci-lint). |
* Replace 'maligned' with 'fieldalignment' [1] * Remove 'interfacer' [2] * Enable linting against go test files as well * Disable 'funlen' linter for go table-driven tests [1] golangci/golangci-lint#1765 [2] golangci/golangci-lint#541
Last week, maligned has been deprecated.
The recommendation is to switch to https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/fieldalignment
Related to #1555
Currently, we don't support
SuggestedFixes
but it's a more global topic.