-
Notifications
You must be signed in to change notification settings - Fork 160
Switch to golangci lint v2, fix or suppress found warnings #797
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
base: master
Are you sure you want to change the base?
Conversation
Generated by go fix ./... Signed-off-by: Kir Kolyshkin <[email protected]>
1. Replaces interface{} with any.
2. Use slices.Contains where appropriate.
Generated by
modernize -fix ./...
Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
The same package is imported twice for no reason. Reported by staticcheck: > generate/seccomp/seccomp_default.go:6:2: ST1019: package "github.com/opencontainers/runtime-spec/specs-go" is being imported more than once (staticcheck) > "github.com/opencontainers/runtime-spec/specs-go" > ^ >generate/seccomp/seccomp_default.go:7:2: ST1019(related information): other import of "github.com/opencontainers/runtime-spec/specs-go" (staticcheck) > rspec "github.com/opencontainers/runtime-spec/specs-go" Signed-off-by: Kir Kolyshkin <[email protected]>
Use switch instead of if/else where appropriate. Signed-off-by: Kir Kolyshkin <[email protected]>
These are the ones we don't want to fix. Signed-off-by: Kir Kolyshkin <[email protected]>
Staticcheck complains: > validation/linux_cgroups_relative_cpus/linux_cgroups_relative_cpus.go:14:17: ST1023: should omit type string from declaration; it will be inferred from the right-hand side (staticcheck) > var cpus, mems string = "0-1", "0" > ^ Fix this, and while at it, use constants. Signed-off-by: Kir Kolyshkin <[email protected]>
Or, in other words, un-Yoda-fy. Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
While at it, bump lint job actions to latest versions. Signed-off-by: Kir Kolyshkin <[email protected]>
b2d3d2d to
1216466
Compare
Signed-off-by: Kir Kolyshkin <[email protected]>
In addition to the one from go.mod (currently 1.21). Signed-off-by: Kir Kolyshkin <[email protected]>
marquiz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
klihub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
/cc @thaJeztah |
|
@AkihiroSuda @giuseppe is this something you can help here? containerd/nri#242 and NVIDIA/nvidia-container-toolkit#1423 depends on #795 and that depends on this |
giuseppe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks it seems merge criteria was met now, so we just need someone to click the button 😅 |
AkihiroSuda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I don't think I should click the merge button as I'm not a maintainer here
https://github.com/opencontainers/runtime-tools/blob/master/MAINTAINERS
|
ping @opencontainers/runtime-tools-maintainers |
|
@mrunalp Could you merge this ? |
Please see individual commits for details.