From 63b2a6117dcae4a910530b4f0049e926e3a1526b Mon Sep 17 00:00:00 2001 From: Jamie Holdstock Date: Mon, 8 Jul 2024 14:52:43 +0100 Subject: [PATCH] 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. --- .github/workflows/go.yml | 2 +- .golangci.yml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 155e9a2..4e871b9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -17,6 +17,6 @@ jobs: - name: Build run: go build ./... - 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 run: ./run_tests.sh diff --git a/.golangci.yml b/.golangci.yml index f79c3b8..e2dea0c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,6 +14,7 @@ linters: - errorlint - exhaustive - exportloopref + - fatcontext - goconst - godot - gofmt @@ -22,8 +23,10 @@ linters: - govet - ineffassign - makezero + - mirror - misspell - nilerr + - nilnil - nosprintfhostport - prealloc - predeclared @@ -33,6 +36,6 @@ linters: - tparallel - typecheck - unconvert + - usestdlibvars - unparam - unused - - vetshadow