Skip to content

Commit e8b5bc5

Browse files
ci: migrate golangci-lint to v2 (#12)
golangci-lint v1.55 (action@v2) can't run against the module's Go version, and the v1 .golangci.toml is rejected by current golangci-lint ("unsupported version of the configuration"). - Migrate the config to the v2 schema (.golangci.yml). Same linter set; gofmt/goimports move to `formatters`, vet->govet (+shadow). - Bump golangci-lint-action v2 -> v9, pin golangci-lint v2.11.4, add a setup-go step on stable, and update actions/checkout v2 -> v7. Code passes the migrated config with 0 issues. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8130d77 commit e8b5bc5

3 files changed

Lines changed: 34 additions & 19 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ jobs:
1313

1414
steps:
1515
- name: Check out code
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v7
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v6
20+
with:
21+
go-version: stable
1722

1823
- name: Lint
19-
uses: golangci/golangci-lint-action@v2
24+
uses: golangci/golangci-lint-action@v9
2025
with:
21-
version: v1.55
26+
version: v2.11.4

.golangci.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.golangci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
version: "2"
2+
3+
run:
4+
timeout: 120s
5+
6+
linters:
7+
enable:
8+
- errcheck
9+
- goconst
10+
- gocyclo
11+
- govet
12+
- ineffassign
13+
- nakedret
14+
- revive
15+
- unconvert
16+
- unparam
17+
- unused
18+
settings:
19+
govet:
20+
enable:
21+
- shadow
22+
23+
formatters:
24+
enable:
25+
- gofmt
26+
- goimports

0 commit comments

Comments
 (0)