Skip to content

Commit 3344f3c

Browse files
authored
add linter (#264)
1 parent 72f1e91 commit 3344f3c

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
pull-requests: read
11+
checks: write
12+
13+
jobs:
14+
golangci:
15+
name: lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
19+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # 5.3.0
20+
with:
21+
go-version: '1.23'
22+
cache: false
23+
- name: golangci-lint
24+
uses: golangci/golangci-lint-action@e60da84bfae8c7920a47be973d75e15710aa8bd7 # v6.3.0
25+
with:
26+
version: v1.63
27+
only-new-issues: true
28+
args: --timeout=5m

.golangci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
linters:
2+
disable-all: true
3+
enable:
4+
- errcheck
5+
- gosimple
6+
- govet
7+
- ineffassign
8+
- staticcheck
9+
- unused
10+
- gofmt
11+
- errorlint
12+
- prealloc
13+
- predeclared
14+
- protogetter
15+
- testifylint
16+
- zerologlint
17+
- copyloopvar
18+
- wrapcheck
19+
- perfsprint

0 commit comments

Comments
 (0)