Skip to content
Merged
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
17 changes: 9 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ^1.20
go-version: ^1.21
cache-dependency-path: go.sum
id: go

- name: Checkout code
uses: actions/checkout@v2

- name: Set up dependencies
run: go mod download

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
uses: golangci/golangci-lint-action@v9
with:
version: v1.52
version: v2.6.1

- name: Run tests
run: go test -v $(go list ./... | grep -v vendor)
run: go test -race -v ./...
119 changes: 73 additions & 46 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
run:
skip-dirs:
- var
version: "2"
linters:
enable:
- asciicheck
Expand All @@ -11,7 +9,6 @@ linters:
- dogsled
- dupl
- durationcheck
- exportloopref
- forbidigo
- funlen
- gocognit
Expand All @@ -20,68 +17,98 @@ linters:
- gocyclo
- godot
- godox
- gofmt
- gofumpt
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- importas
- ineffassign
- lll
- makezero
- misspell
- nakedret
- nestif
- nilerr
- noctx
- noctx
- nolintlint
- prealloc
- predeclared
- promlinter
- revive
- stylecheck
- tenv
- staticcheck
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- whitespace

issues:
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- contextcheck
- cyclop
- dupl
- errcheck
- exportloopref
- funlen
- gochecknoglobals
- goconst
- gocritic
- gocyclo
- gosec
- lll
- path: errors\.go
linters:
- errcheck
- path: stack\.go
linters:
- errcheck
- goconst
- gocritic

linters-settings:
revive:
settings:
depguard:
rules:
main:
files:
- $all
- '!$test'
- '!**/test/**/*'
allow:
- $gostd
- github.com
test:
files:
- $test
allow:
- $gostd
- github.com
revive:
rules:
- name: var-naming
disabled: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- name: var-naming
disabled: true
- linters:
- contextcheck
- cyclop
- dupl
- errcheck
- exportloopref
- funlen
- gochecknoglobals
- gocognit
- goconst
- gocritic
- gocyclo
- gosec
- lll
- nestif
path: _test\.go
- linters:
- errcheck
path: errors\.go
- linters:
- nestif
path: errorstest
- linters:
- errcheck
- goconst
- gocritic
path: stack\.go
paths:
- var
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
Loading