Switch to golangci lint v2, fix or suppress found warnings#797
Switch to golangci lint v2, fix or suppress found warnings#797kolyshkin merged 12 commits intoopencontainers:masterfrom
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]>
|
/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 |
|
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.
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 ? |
|
@giuseppe Would you be willing to merge this so we could kick things moving forward ? |
Please see individual commits for details.