Skip to content

Switch to golangci-lint v2#230

Merged
kolyshkin merged 2 commits intoopencontainers:mainfrom
kolyshkin:golangci-v2
Mar 26, 2025
Merged

Switch to golangci-lint v2#230
kolyshkin merged 2 commits intoopencontainers:mainfrom
kolyshkin:golangci-v2

Conversation

@kolyshkin
Copy link
Copy Markdown
Collaborator

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.

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]>
Copy link
Copy Markdown
Collaborator

@rhatdan rhatdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually; it looks like nobody may be using the ErrIncompatibleLabel error as a sentinel error

https://grep.app/search?case=true&q=.ErrIncompatibleLabel

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!)

@kolyshkin kolyshkin marked this pull request as ready for review March 26, 2025 16:33
@kolyshkin kolyshkin merged commit cf2eadf into opencontainers:main Mar 26, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants