Skip to content

Commit 316d76c

Browse files
add: Lint checker
1 parent f97aba1 commit 316d76c

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/lint.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Go Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "**" # Run on push to any branch
7+
pull_request:
8+
branches:
9+
- "**" # Run on any pull request, regardless of the source branch
10+
11+
jobs:
12+
lint:
13+
name: Lint Go code
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v3
22+
with:
23+
go-version: "1.20" # Specify your Go version here
24+
25+
- name: Cache Go modules
26+
uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.cache/go-build
30+
~/.go/pkg/mod
31+
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
32+
restore-keys: |
33+
${{ runner.os }}-go-mod-
34+
35+
- name: Install golangci-lint
36+
run: |
37+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
38+
39+
- name: Run golangci-lint
40+
run: |
41+
golangci-lint run

0 commit comments

Comments
 (0)