From a7b4df003f78432b15238faaf1127bdc59865d1a Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Tue, 10 Mar 2026 17:07:18 -0700 Subject: [PATCH 1/3] Update github runner version Signed-off-by: Derek McGowan --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37efec5..d20f155 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: strategy: matrix: - os: [ubuntu-22.04, macos-13, windows-2022] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/setup-go@v5 @@ -50,7 +50,7 @@ jobs: project: name: Project Checks if: github.repository == 'containerd/platforms' - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 5 steps: @@ -76,7 +76,7 @@ jobs: strategy: matrix: - os: [ubuntu-22.04, macos-13, windows-2022] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 From 50e5387229bf3d220cd22b0ec08ee1c413053760 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Tue, 10 Mar 2026 17:08:42 -0700 Subject: [PATCH 2/3] Update go version to latest Signed-off-by: Derek McGowan --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d20f155..878e375 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: env: # Go version we currently use to build containerd across all CI. # Note: don't forget to update `Binaries` step, as it contains the matrix of all supported Go versions. - GO_VERSION: "1.23.9" + GO_VERSION: "1.25" permissions: # added using https://github.com/step-security/secure-workflows contents: read From 7c872f615218b0e17467c01cfd6488a928ee5c07 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Wed, 11 Mar 2026 10:09:26 -0700 Subject: [PATCH 3/3] Update golangci lint Signed-off-by: Derek McGowan --- .github/workflows/ci.yml | 6 ++---- .golangci.yml | 37 +++++++++++++++---------------------- cpuinfo_other.go | 7 ++++--- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 878e375..4f848dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,11 +38,9 @@ jobs: cache: false # see actions/setup-go#368 - uses: actions/checkout@v4 - - uses: golangci/golangci-lint-action@v6 + - uses: golangci/golangci-lint-action@v7 with: - version: v1.61.0 - skip-cache: true - args: --timeout=5m + version: v2.1.5 # # Project checks diff --git a/.golangci.yml b/.golangci.yml index d574fe1..9320503 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,32 +1,25 @@ +version: "2" linters: enable: - copyloopvar - - gofmt - - goimports + - dupword - gosec - - ineffassign - misspell - nolintlint - revive - - staticcheck - - tenv # Detects using os.Setenv instead of t.Setenv since Go 1.17 - unconvert - - unused - - govet - - dupword # Checks for duplicate words in the source code disable: - errcheck - -run: - timeout: 5m - -issues: - exclude-dirs: - - api - - cluster - - design - - docs - - docs/man - - releases - - reports - - test # e2e scripts + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax diff --git a/cpuinfo_other.go b/cpuinfo_other.go index 97a1fe8..5bbfef7 100644 --- a/cpuinfo_other.go +++ b/cpuinfo_other.go @@ -27,7 +27,8 @@ func getCPUVariant() (string, error) { var variant string - if runtime.GOOS == "windows" || runtime.GOOS == "darwin" { + switch runtime.GOOS { + case "windows", "darwin": // Windows/Darwin only supports v7 for ARM32 and v8 for ARM64 and so we can use // runtime.GOARCH to determine the variants switch runtime.GOARCH { @@ -38,7 +39,7 @@ func getCPUVariant() (string, error) { default: variant = "unknown" } - } else if runtime.GOOS == "freebsd" { + case "freebsd": // FreeBSD supports ARMv6 and ARMv7 as well as ARMv4 and ARMv5 (though deprecated) // detecting those variants is currently unimplemented switch runtime.GOARCH { @@ -47,7 +48,7 @@ func getCPUVariant() (string, error) { default: variant = "unknown" } - } else { + default: return "", fmt.Errorf("getCPUVariant for OS %s: %v", runtime.GOOS, errNotImplemented) }