Skip to content

Commit d4690f3

Browse files
committed
CI: Add golangci-lint
1 parent cfa118a commit d4690f3

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/testing.yml

+22-1
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,25 @@ jobs:
8888
with:
8989
version: "2025.1.1"
9090
install-go: false
91-
cache-key: ${{ matrix.go-version }}-${{ matrix.os }}
91+
cache-key: ${{ matrix.go-version }}-${{ matrix.os }}
92+
93+
golangci-lint:
94+
name: golangci-lint
95+
strategy:
96+
fail-fast: false
97+
matrix:
98+
go-version: [ '1.23', '1.24' ]
99+
os: [ 'windows-latest', 'ubuntu-latest', 'macOS-latest' ]
100+
runs-on: ${{ matrix.os }}
101+
102+
steps:
103+
- uses: actions/checkout@v4
104+
- name: Setup Go ${{ matrix.go-version }}
105+
uses: actions/setup-go@v5
106+
with:
107+
go-version: ${{ matrix.go-version }}
108+
109+
- name: Run golangci-lint (Go ${{ matrix.go }})
110+
uses: golangci/golangci-lint-action@v7
111+
with:
112+
version: v2.0

.golangci.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: "2"
2+
linters:
3+
# Default set of linters.
4+
# The value can be: `standard`, `all`, `none`, or `fast`.
5+
default: standard
6+
# Disable specific linter
7+
# https://golangci-lint.run/usage/linters/#disabled-by-default
8+
enable:
9+
- errcheck
10+
- govet
11+
- ineffassign
12+
- unused
13+
- misspell
14+
disable:
15+
- staticcheck
16+
run:
17+
# Timeout for total work, e.g. 30s, 5m, 5m30s.
18+
# If the value is lower or equal to 0, the timeout is disabled.
19+
# Default: 0 (disabled)
20+
timeout: 5m

0 commit comments

Comments
 (0)