Skip to content

Commit 5614c26

Browse files
committed
feat: upgrade golangci-lint to v2
Use the latest version of `golangci-lint` and fix the CI workflow.
1 parent 5634add commit 5614c26

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

.github/workflows/lint.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version-file: 'go.mod'
20+
go-version-file: "go.mod"
2121

2222
- name: Verify dependencies
2323
run: |
2424
go mod verify
2525
go mod download
2626
27-
LINT_VERSION=1.64.8
27+
LINT_VERSION=2.1.6
2828
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
2929
tar xz --strip-components 1 --wildcards \*/golangci-lint
3030
mkdir -p bin && mv golangci-lint bin/
@@ -45,6 +45,6 @@ jobs:
4545
assert-nothing-changed go fmt ./...
4646
assert-nothing-changed go mod tidy
4747
48-
bin/golangci-lint run --out-format=colored-line-number --timeout=3m || STATUS=$?
48+
bin/golangci-lint run --timeout=3m || STATUS=$?
4949
5050
exit $STATUS

.golangci.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1+
# https://golangci-lint.run/usage/configuration
2+
version: "2"
3+
14
run:
25
timeout: 5m
36
tests: true
47
concurrency: 4
58

69
linters:
710
enable:
8-
- govet
11+
- bodyclose
912
- errcheck
10-
- staticcheck
11-
- gofmt
12-
- goimports
13-
- revive
13+
- gocritic
14+
- gosec
15+
- govet
1416
- ineffassign
15-
- typecheck
16-
- unused
17-
- gosimple
17+
- makezero
1818
- misspell
1919
- nakedret
20-
- bodyclose
21-
- gocritic
22-
- makezero
23-
- gosec
20+
- revive
21+
- staticcheck
22+
- unused
23+
24+
formatters:
25+
enable:
26+
- gci
27+
- gofmt
28+
- goimports
29+
- golines
2430

2531
output:
26-
formats: colored-line-number
27-
print-issued-lines: true
28-
print-linter-name: true
32+
formats:
33+
text:
34+
print-linter-name: true
35+
print-issued-lines: true

0 commit comments

Comments
 (0)