Use latest golangci-lint release and update linter list. (#484)

* ci: Update linter to 1.59.1.

Also remove deprecated linter "vetshadow", its functionality is now
included in the "govet" linter.

* ci: Add new linters.

- fatcontext - Detects nested contexts in loops.
- mirror - Reports wrong mirror patterns of bytes/strings usage.
- nilnil - Checks that there is no simultaneous return of nil error and
  an invalid value.
- usestdlibvars - detect the possibility to use variables/constants from
  the Go standard library.
This commit is contained in:
Jamie Holdstock 2024-07-08 14:52:43 +01:00 committed by GitHub
parent aa8d2a34ea
commit 63b2a6117d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View File

@ -17,6 +17,6 @@ jobs:
- name: Build - name: Build
run: go build ./... run: go build ./...
- name: Install Linters - name: Install Linters
run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.1" run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1"
- name: Test and Lint - name: Test and Lint
run: ./run_tests.sh run: ./run_tests.sh

View File

@ -14,6 +14,7 @@ linters:
- errorlint - errorlint
- exhaustive - exhaustive
- exportloopref - exportloopref
- fatcontext
- goconst - goconst
- godot - godot
- gofmt - gofmt
@ -22,8 +23,10 @@ linters:
- govet - govet
- ineffassign - ineffassign
- makezero - makezero
- mirror
- misspell - misspell
- nilerr - nilerr
- nilnil
- nosprintfhostport - nosprintfhostport
- prealloc - prealloc
- predeclared - predeclared
@ -33,6 +36,6 @@ linters:
- tparallel - tparallel
- typecheck - typecheck
- unconvert - unconvert
- usestdlibvars
- unparam - unparam
- unused - unused
- vetshadow