Switch to golangci-lint v2#230
Merged
kolyshkin merged 2 commits intoopencontainers:mainfrom Mar 26, 2025
Merged
Conversation
This fixes the following linter warnings:
> go-selinux/label/label_linux.go:21:28: ST1005: error strings should not be capitalized (staticcheck)
> var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be used together")
> ^
> go-selinux/label/label_linux.go:55:20: ST1005: error strings should not be capitalized (staticcheck)
> return "", "", fmt.Errorf("Bad label option %q, valid options 'disable' or \n'user, role, level, type, filetype' followed by ':' and a value", opt)
> ^
> go-selinux/label/label_linux.go:59:20: ST1005: error strings should not be capitalized (staticcheck)
> return "", "", fmt.Errorf("Bad label option %q, valid options 'disable, user, role, level, type, filetype'", con[0])
> ^
Signed-off-by: Kir Kolyshkin <[email protected]>
The configuration was migrated using golangci-lint migrate and when tweaked manually trying to minimize it. Signed-off-by: Kir Kolyshkin <[email protected]>
thaJeztah
approved these changes
Mar 26, 2025
Member
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM (one ready / out of draft)
| } | ||
|
|
||
| var ErrIncompatibleLabel = errors.New("Bad SELinux option z and Z can not be used together") | ||
| var ErrIncompatibleLabel = errors.New("bad SELinux option: z and Z can not be used together") |
Member
There was a problem hiding this comment.
👍 Did a quick search to see if there's any code string-matching the error, but I don't think there is (nothing found outside of vendor/ AFAICS https://grep.app/search?case=true&q=Bad+SELinux+option
Member
There was a problem hiding this comment.
Actually; it looks like nobody may be using the ErrIncompatibleLabel error as a sentinel error
I don't know if there would be any reason for anyone to treat this error special; if there's not, we could consider deprecating it.
(but that's definitely unrelated to this PR!)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The configuration was migrated using golangci-lint migrate and when
tweaked manually trying to minimize it.
Also, fix some new warnings reported by updated staticcheck.