diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index cfc3f90c..1524cb00 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -27,10 +27,10 @@ jobs: format: auto config_file: .yamllint.yaml - - uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0 + - uses: golangci/golangci-lint-action@v8 with: args: --verbose - version: v1.57.1 + version: v2.3.0 build: name: Build all linux architectures diff --git a/.golangci.yml b/.golangci.yml index 0dd3fc25..7df40090 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,30 +1,40 @@ +version: "2" linters: enable: - contextcheck - - errcheck - errorlint - - gci - ginkgolinter - gocritic - - gofumpt - - govet - - ineffassign - misspell - nolintlint - nonamedreturns - predeclared - - staticcheck - - typecheck - unconvert - - unused - whitespace - -linters-settings: - gci: - sections: - - standard - - default - - prefix(github.com/containernetworking) - -run: - timeout: 5m + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gci + - gofumpt + settings: + gci: + sections: + - standard + - default + - prefix(github.com/containernetworking) + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/cnitool/cmd/root.go b/cnitool/cmd/root.go index f497f157..61b3f545 100644 --- a/cnitool/cmd/root.go +++ b/cnitool/cmd/root.go @@ -1,4 +1,4 @@ -// Copyright 2015 CNI authors +// Copyright CNI authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,8 +22,9 @@ import ( "path/filepath" "strings" - "github.com/containernetworking/cni/libcni" "github.com/spf13/cobra" + + "github.com/containernetworking/cni/libcni" ) // Protocol parameters are passed to the plugins via OS environment variables. diff --git a/pkg/version/version.go b/pkg/version/version.go index cfb6a12f..1ab953ce 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -40,12 +40,12 @@ var ( ) // VersionsFrom returns a list of versions starting from min, inclusive -func VersionsStartingFrom(min string) PluginInfo { +func VersionsStartingFrom(minimum string) PluginInfo { out := []string{} // cheat, just assume ordered ok := false for _, v := range All.SupportedVersions() { - if !ok && v == min { + if !ok && v == minimum { ok = true } if ok {