From d47e380ecce8bcaebda0a290d3f14f550d4448db Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 25 Mar 2025 14:03:29 -0400 Subject: [PATCH 1/2] ci: Use go 1.24 rather than 1.22 Signed-off-by: Stefan Berger --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index f7e9407..5bcd62e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.22', '1.23' ] + go: [ '1.24', '1.23' ] name: Go Version ${{ matrix.go }} steps: - uses: actions/checkout@v3 From 36ff654a78144fd99d43aded7719e250a3c86373 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Tue, 25 Mar 2025 14:08:52 -0400 Subject: [PATCH 2/2] ci: Use golangci-lint v2.0.1 Use 'golangcli-lint migrate' to migrate the configuration file to the new format. Signed-off-by: Stefan Berger --- .github/workflows/go.yml | 2 +- .golangci.yml | 70 +++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5bcd62e..f71a7ff 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,7 +28,7 @@ jobs: go-version: ${{ matrix.go }} - name: Install - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2 + run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.0.1 - name: Build run: make diff --git a/.golangci.yml b/.golangci.yml index bf39af8..b77ab6d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,35 +1,47 @@ +version: "2" linters: enable: - depguard - - staticcheck + - misspell + - revive - unconvert + settings: + depguard: + rules: + main: + files: + - $all + deny: + - pkg: io/ioutil + revive: + severity: error + rules: + - name: indent-error-flow + severity: warning + disabled: false + - name: error-strings + disabled: false + staticcheck: + checks: + - -SA1019 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: - gofmt - goimports - - revive - - ineffassign - - govet - - unused - - misspell - -linters-settings: - depguard: - rules: - main: - files: - - $all - deny: - - pkg: "io/ioutil" - - revive: - severity: error - rules: - - name: indent-error-flow - severity: warning - disabled: false - - - name: error-strings - disabled: false - - staticcheck: - # Suppress reports of deprecated packages - checks: ["-SA1019"] + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$