Go project template I use with pre-configured CI
template
1name: Lint
2on:
3 pull_request:
4 paths:
5 - "**/*.go"
6 - "go.mod"
7 - "go.sum"
8 - "**/go.mod"
9 - "**/go.sum"
10 merge_group:
11permissions:
12 contents: read
13jobs:
14 golangci:
15 name: golangci-lint
16 runs-on: ubuntu-latest
17 steps:
18 - uses: actions/checkout@v4
19 - uses: actions/setup-go@v5
20 with:
21 go-version: "stable"
22 check-latest: true
23 - name: run linting
24 run: |
25 go tool github.com/golangci/golangci-lint/cmd/golangci-lint run ./... --timeout 15m