From 12d56e4865b119ccfff8bb93db387434103188e3 Mon Sep 17 00:00:00 2001 From: Christopher Junius Date: Sun, 30 Aug 2026 16:40:12 -0400 Subject: [PATCH 1/3] chore: bump Go to 1.27 and update GitHub Actions - go.mod: go 1.22.3 -> 1.27.0 - CI/lint/codeql/release workflows: build/test on Go 1.27.x - Incorporate dependabot github-actions group bumps (PR #3): - actions/checkout v4 -> v7 - actions/setup-go v5 -> v7 - codecov/codecov-action v4 -> v7 - github/codeql-action v3 -> v4 - golangci/golangci-lint-action v6 -> v9 - goreleaser/goreleaser-action v6 -> v7 Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/codeql.yml | 12 ++++++------ .github/workflows/lint.yml | 14 +++++++------- .github/workflows/release.yml | 8 ++++---- go.mod | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e03cc3..da14ee4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,16 +19,16 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - go: ["1.22.x", "1.23.x"] + go: ["1.27.x"] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 with: go-version: ${{ matrix.go }} check-latest: true - name: Verify modules are tidy - if: matrix.os == 'ubuntu-latest' && matrix.go == '1.23.x' + if: matrix.os == 'ubuntu-latest' && matrix.go == '1.27.x' run: | go mod tidy git diff --exit-code -- go.mod go.sum @@ -42,8 +42,8 @@ jobs: if: matrix.os == 'ubuntu-latest' run: go test -race ./... - name: Upload coverage - if: matrix.os == 'ubuntu-latest' && matrix.go == '1.23.x' - uses: codecov/codecov-action@v4 + if: matrix.os == 'ubuntu-latest' && matrix.go == '1.27.x' + uses: codecov/codecov-action@v7 with: files: coverage.txt fail_ci_if_error: false @@ -53,10 +53,10 @@ jobs: vuln: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 with: - go-version: "1.23.x" + go-version: "1.27.x" - name: govulncheck run: | go install golang.org/x/vuln/cmd/govulncheck@v1.1.4 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 45099d5..0ed73a9 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,16 +19,16 @@ jobs: contents: read security-events: write steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 with: - go-version: "1.23.x" + go-version: "1.27.x" - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: go queries: security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@v4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a92987a..a36542a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,22 +13,22 @@ jobs: golangci: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 with: - go-version: "1.23.x" + go-version: "1.27.x" - name: golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@v9 with: version: v1.61.0 gofumpt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-go@v7 with: - go-version: "1.23.x" + go-version: "1.27.x" - name: Check formatting run: | go install mvdan.cc/gofumpt@latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d8c6d0..71ff9de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,16 +14,16 @@ jobs: contents: write # create the GitHub Release id-token: write # keyless signing / provenance steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 - - uses: actions/setup-go@v5 + - uses: actions/setup-go@v7 with: - go-version: "1.23.x" + go-version: "1.27.x" - name: Install Syft (SBOM generation) uses: anchore/sbom-action/download-syft@v0 - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v6 + uses: goreleaser/goreleaser-action@v7 with: version: "~> v2" args: release --clean diff --git a/go.mod b/go.mod index b9b0298..27756fd 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/cjunius/goChess -go 1.22.3 +go 1.27.0 require github.com/dylhunn/dragontoothmg v0.0.0-20220917014754-e79413b50d93 From 293d549b0575d67ddd0bb00374716bc7afcbdf5d Mon Sep 17 00:00:00 2001 From: Christopher Junius Date: Sun, 30 Aug 2026 16:43:29 -0400 Subject: [PATCH 2/3] chore: update tooling to latest - golangci-lint v1.61.0 -> v2.13.2; migrate .golangci.yml to the v2 schema (formatters split out, exclusions restructured); update the install path to the /v2 module in Makefile and the CI pin - Dockerfile: distroless static-debian12 -> static-debian13 (Debian 13 is now stable) Go module deps (dragontoothmg) already at latest; GitHub Actions already pinned to their latest majors (checkout v7, setup-go v7, codecov v7, codeql v4, golangci-lint-action v9, goreleaser v7). Co-Authored-By: Claude Sonnet 5 --- .github/workflows/lint.yml | 2 +- .golangci.yml | 81 ++++++++++++++++++++++---------------- Dockerfile | 2 +- Makefile | 4 +- 4 files changed, 51 insertions(+), 38 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a36542a..84d4a31 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,7 +20,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v9 with: - version: v1.61.0 + version: v2.13.2 gofumpt: runs-on: ubuntu-latest diff --git a/.golangci.yml b/.golangci.yml index 72e95f0..d8b624c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,59 +1,72 @@ -# golangci-lint configuration. Run: make lint (or: golangci-lint run) +# golangci-lint configuration (v2 schema). Run: make lint (or: golangci-lint run) +version: "2" run: - timeout: 5m tests: true - linters: enable: - asasalint - bodyclose - copyloopvar - dupl - - errcheck - errorlint - gocritic - gocyclo - - gofumpt - - goimports - gosec - - govet - - ineffassign - misspell - nakedret - nilerr - nolintlint - predeclared - revive - - staticcheck - unconvert - unparam - - unused - whitespace - -linters-settings: - gocyclo: - min-complexity: 20 - goimports: - local-prefixes: github.com/cjunius/goChess - govet: - enable-all: true - disable: - - fieldalignment - revive: + settings: + dupl: + threshold: 150 + gocyclo: + min-complexity: 20 + govet: + disable: + - fieldalignment + enable-all: true + revive: + rules: + - name: exported + arguments: + - checkPrivateReceivers + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling rules: - - name: exported - arguments: ["checkPrivateReceivers"] - dupl: - threshold: 150 - + - linters: + - dupl + - gocyclo + - gosec + - unparam + path: _test\.go + paths: + - third_party$ + - builtin$ + - examples$ issues: max-issues-per-linter: 0 max-same-issues: 0 - exclude-rules: - # Test files: allow table-driven duplication and skip some strictness. - - path: _test\.go - linters: - - dupl - - gocyclo - - gosec - - unparam +formatters: + enable: + - gofumpt + - goimports + settings: + goimports: + local-prefixes: + - github.com/cjunius/goChess + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/Dockerfile b/Dockerfile index b5247b0..b86f3a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN CGO_ENABLED=0 go build -trimpath \ -ldflags="-s -w -X main.version=${VERSION} -X main.commit=${COMMIT} -X main.date=${DATE}" \ -o /out/gochess ./cmd/gochess -FROM gcr.io/distroless/static-debian12:nonroot +FROM gcr.io/distroless/static-debian13:nonroot COPY --from=build /out/gochess /usr/local/bin/gochess # UCI speaks over stdin/stdout; keep the container attached. ENTRYPOINT ["/usr/local/bin/gochess"] diff --git a/Makefile b/Makefile index 429b2e5..6ee2cb1 100644 --- a/Makefile +++ b/Makefile @@ -77,13 +77,13 @@ tidy: check: tidy lint vuln test ## dev-tools: install development tooling (versions tracked here and in CI) -GOLANGCI_VERSION ?= v1.61.0 +GOLANGCI_VERSION ?= v2.13.2 .PHONY: dev-tools dev-tools: $(GO) install mvdan.cc/gofumpt@latest $(GO) install golang.org/x/tools/cmd/goimports@latest $(GO) install golang.org/x/vuln/cmd/govulncheck@v1.1.4 - $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_VERSION) + $(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_VERSION) ## docker: build the container image .PHONY: docker From 85974ed9fd9d1757deb786310a1244c0fe9b3f05 Mon Sep 17 00:00:00 2001 From: Christopher Junius Date: Sun, 30 Aug 2026 16:45:11 -0400 Subject: [PATCH 3/3] ci: bump govulncheck v1.1.4 -> v1.7.0 v1.1.4 panics ("unexpected expr: *ast.KeyValueExpr") when scanning code built with Go 1.27; v1.7.0 scans clean. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/ci.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da14ee4..409ea34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,5 +59,5 @@ jobs: go-version: "1.27.x" - name: govulncheck run: | - go install golang.org/x/vuln/cmd/govulncheck@v1.1.4 + go install golang.org/x/vuln/cmd/govulncheck@v1.7.0 govulncheck ./... diff --git a/Makefile b/Makefile index 6ee2cb1..d01f374 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ GOLANGCI_VERSION ?= v2.13.2 dev-tools: $(GO) install mvdan.cc/gofumpt@latest $(GO) install golang.org/x/tools/cmd/goimports@latest - $(GO) install golang.org/x/vuln/cmd/govulncheck@v1.1.4 + $(GO) install golang.org/x/vuln/cmd/govulncheck@v1.7.0 $(GO) install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_VERSION) ## docker: build the container image