From 295ead923591f502b2cb6d79ade6cba18d0fa25a Mon Sep 17 00:00:00 2001 From: Shankar Date: Fri, 27 Mar 2026 23:01:06 -0400 Subject: [PATCH] fix(ci): upgrade golangci-lint v1.62.2 to v2.11.4 for Go 1.25 support The old v1 binary was built with Go 1.23 and rejected Go 1.25 targets. Migrated .golangci.yml to v2 format: added version field, moved linters-settings under linters.settings, removed deprecated linters (structcheck/deadcode/varcheck), merged gosimple into staticcheck. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yml | 2 +- .golangci.yml | 38 +++++++++++++++++--------------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee7ea5e..37143f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - name: Install golangci-lint run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.11.4 - name: Run golangci-lint run: golangci-lint run ./... --timeout 5m diff --git a/.golangci.yml b/.golangci.yml index f2039e7..bfb4168 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,36 +1,32 @@ +version: "2" + run: timeout: 5m linters: + default: none enable: - errcheck - govet - staticcheck - unused - - gosimple - ineffassign - typecheck - gocritic - gosec - bodyclose - noctx - disable: - - structcheck # deprecated - - deadcode # deprecated - - varcheck # deprecated - -linters-settings: - errcheck: - check-type-assertions: true - gocritic: - enabled-tags: - - diagnostic - - performance - gosec: - excludes: - - G104 # Audit errors not checked (we have intentional fire-and-forget patterns) - - G304 # File inclusion via variable (needed for config-driven file paths) - -issues: - max-issues-per-linter: 50 - max-same-issues: 5 + settings: + errcheck: + check-type-assertions: true + gocritic: + enabled-tags: + - diagnostic + - performance + gosec: + excludes: + - G104 # Audit errors not checked (we have intentional fire-and-forget patterns) + - G304 # File inclusion via variable (needed for config-driven file paths) + exclusions: + max-issues-per-linter: 50 + max-same-issues: 5