Skip to content

Commit b363c3c

Browse files
committed
Update to golangci-lint v2, Go 1.24
Change CI to test with Go 1.24 and drop 1.21. Migrate the golangci-lint config to v2 format as that's the default for the golangci-lint GitHub Action now.
1 parent 5dc9499 commit b363c3c

File tree

2 files changed

+49
-49
lines changed

2 files changed

+49
-49
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
runs-on: ${{ matrix.os }}
3131
strategy:
3232
matrix:
33-
go-version: ['1.23.x', '1.22.x', '1.21.x']
33+
go-version: ['1.24.x', '1.23.x', '1.22.x']
3434
arch: ['amd64', '386', 'arm64']
3535
os: ['ubuntu-latest']
3636
include:
3737
- os: 'macos-latest'
3838
arch: 'amd64'
39-
go-version: '1.23.x'
39+
go-version: '1.24.x'
4040
- os: 'windows-latest'
4141
arch: 'amd64'
42-
go-version: '1.23.x'
42+
go-version: '1.24.x'
4343

4444
steps:
4545
- name: Checkout code
@@ -95,7 +95,7 @@ jobs:
9595
go-version-file: go.mod
9696
cache: false # managed by golangci-lint
9797

98-
- uses: golangci/golangci-lint-action@v6
98+
- uses: golangci/golangci-lint-action@v8
9999
name: Install golangci-lint
100100
with:
101101
version: latest

.golangci.yml

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
output:
2-
# Make output more digestible with quickfix in vim/emacs/etc.
3-
sort-results: true
4-
print-issued-lines: false
1+
version: "2"
2+
3+
# Print all issues reported by all linters.
4+
issues:
5+
max-issues-per-linter: 0
6+
max-same-issues: 0
57

68
linters:
79
# We'll track the golangci-lint default linters manually
810
# instead of letting them change without our control.
9-
disable-all: true
11+
default: none
1012
enable:
1113
# golangci-lint defaults:
1214
- errcheck
13-
- gosimple
1415
- govet
1516
- ineffassign
1617
- staticcheck
1718
- unused
1819

1920
# Our own extras:
20-
- gofumpt
21-
- nolintlint # lints nolint directives
2221
- revive
23-
24-
linters-settings:
25-
govet:
26-
# These govet checks are disabled by default, but they're useful.
27-
enable:
28-
- niliness
29-
- reflectvaluecompare
30-
- sortslice
31-
- unusedwrite
32-
33-
errcheck:
34-
exclude-functions:
35-
# Writing a plain string to a fmt.State cannot fail.
36-
- io.WriteString(fmt.State)
37-
- fmt.Fprintf(fmt.State)
38-
39-
issues:
40-
# Print all issues reported by all linters.
41-
max-issues-per-linter: 0
42-
max-same-issues: 0
43-
44-
# Don't ignore some of the issues that golangci-lint considers okay.
45-
# This includes documenting all exported entities.
46-
exclude-use-default: false
47-
48-
exclude-rules:
49-
# Don't warn on unused parameters.
50-
# Parameter names are useful; replacing them with '_' is undesirable.
51-
- linters: [revive]
52-
text: 'unused-parameter: parameter \S+ seems to be unused, consider removing or renaming it as _'
53-
54-
# staticcheck already has smarter checks for empty blocks.
55-
# revive's empty-block linter has false positives.
56-
# For example, as of writing this, the following is not allowed.
57-
# for foo() { }
58-
- linters: [revive]
59-
text: 'empty-block: this block is empty, you can remove it'
22+
- nolintlint
23+
24+
settings:
25+
26+
errcheck:
27+
exclude-functions:
28+
# Writing a plain string to a fmt.State cannot fail.
29+
- io.WriteString(fmt.State)
30+
- fmt.Fprintf(fmt.State)
31+
32+
govet:
33+
# These govet checks are disabled by default, but they're useful.
34+
enable:
35+
- nilness
36+
- reflectvaluecompare
37+
- sortslice
38+
- unusedwrite
39+
40+
exclusions:
41+
generated: lax
42+
rules:
43+
# Don't warn on unused parameters.
44+
# Parameter names are useful; replacing them with '_' is undesirable.
45+
- linters: [revive]
46+
text: 'unused-parameter: parameter \S+ seems to be unused, consider removing or renaming it as _'
47+
48+
# staticcheck already has smarter checks for empty blocks.
49+
# revive's empty-block linter has false positives.
50+
# For example, as of writing this, the following is not allowed.
51+
# for foo() { }
52+
- linters: [revive]
53+
text: 'empty-block: this block is empty, you can remove it'
54+
55+
formatters:
56+
enable:
57+
- gofumpt
58+
exclusions:
59+
generated: lax

0 commit comments

Comments
 (0)