Skip to content

CI: Add golangci-lint #712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,25 @@ jobs:
with:
version: "2025.1.1"
install-go: false
cache-key: ${{ matrix.go-version }}-${{ matrix.os }}
cache-key: ${{ matrix.go-version }}-${{ matrix.os }}

golangci-lint:
name: golangci-lint
strategy:
fail-fast: false
matrix:
go-version: [ '1.23', '1.24' ]
os: [ 'windows-latest', 'ubuntu-latest', 'macOS-latest' ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- name: Run golangci-lint (Go ${{ matrix.go }})
uses: golangci/golangci-lint-action@v7
with:
version: v2.0
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: "2"
linters:
# Default set of linters.
# The value can be: `standard`, `all`, `none`, or `fast`.
default: standard
# Disable specific linter
# https://golangci-lint.run/usage/linters/#disabled-by-default
enable:
- errcheck
- govet
- ineffassign
- unused
- misspell
disable:
- staticcheck
run:
# Timeout for total work, e.g. 30s, 5m, 5m30s.
# If the value is lower or equal to 0, the timeout is disabled.
# Default: 0 (disabled)
timeout: 5m
Loading