Skip to content
Merged

Next #20

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
15 changes: 8 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,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.16
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.63
version: v2.6.1

- name: Run tests
run: go test -v $(go list ./... | grep -v vendor)
run: go test -race -v ./...
109 changes: 59 additions & 50 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: "2"
linters:
enable:
- asciicheck
Expand All @@ -8,85 +9,93 @@ linters:
- depguard
- dogsled
- durationcheck
- errcheck
- errorlint
- forbidigo
- funlen
- gci
- gocognit
- goconst
- gocritic
- gocyclo
- godot
- godox
- gofmt
- gofumpt
- goimports
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- importas
- ineffassign
- makezero
- misspell
- nakedret
- nestif
- nilerr
- noctx
- noctx
- nolintlint
- prealloc
- predeclared
- promlinter
- rowserrcheck
- sqlclosecheck
- stylecheck
- tenv
- staticcheck
- testpackage
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- whitespace

issues:
exclude-dirs:
- var
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
linters:
- funlen
- lll
- gocyclo
- errcheck
- dupl
- gosec
- scopelint
- gochecknoglobals
- goerr113

linters-settings:
depguard:
settings:
depguard:
rules:
main:
files:
- $all
- '!$test'
- '!**/test/**/*'
allow:
- $gostd
- github.com
- gopkg.in
test:
files:
- $test
allow:
- $gostd
- github.com
gosec:
excludes:
- G115
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
main:
files:
- $all
- "!$test"
- "!**/test/**/*"
allow:
- $gostd
- github.com
test:
files:
- "$test"
allow:
- $gostd
- github.com
gosec:
excludes:
- G115
- linters:
- dupl
- err113
- errcheck
- funlen
- gochecknoglobals
- gocyclo
- gosec
- lll
- scopelint
path: _test\.go
paths:
- var
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- var
- third_party$
- builtin$
- examples$
Loading