From 3e60efbc1067c564b337f904da825802b99a9279 Mon Sep 17 00:00:00 2001 From: Sven Greb Date: Mon, 26 Apr 2021 21:11:47 +0200 Subject: [PATCH] Update to golangci-lint `v1.39.x` (#57) The currently latest `golangci-lint` version 1.39.0 [1] introduced new linters and updated supported ones: 1. predeclared [2] (v1.35.0 [3]) - Checks for definitions and declarations that shadows one of Go's pre-declared identifiers [4]. This linter is disabled by default, but is enabled for this template to help to prevent shadowed identifiers. 2. interfacer [5] (v1.38.0 [6]) - Has been deprecated [7] and removed from this template. 3. scopelint [8] (v1.39.0 [9]) - Has been deprecated [10] and replaced by exportloopref [11]. The `exportloopref` linter is disabled by default, but is enabled for this template to help to catch loop variable bugs. [1]: https://github.com/golangci/golangci-lint/releases/tag/v1.39.0 [2]: https://github.com/nishanths/predeclared [3]: https://github.com/golangci/golangci-lint/releases/tag/v1.35.0 [4]: https://golang.org/ref/spec#Predeclared_identifiers [5]: https://github.com/mvdan/interfacer [6]: https://github.com/golangci/golangci-lint/releases/tag/v1.38.0 [7]: https://github.com/golangci/golangci-lint/pull/1755 [8]: https://github.com/kyoh86/scopelint [9]: https://github.com/golangci/golangci-lint/releases/tag/v1.39.0 [10]: https://github.com/golangci/golangci-lint/pull/1819 [11]: https://github.com/kyoh86/exportloopref Closes GH-56 --- .github/workflows/ci.yml | 2 +- .golangci.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00db24e..d9b5f58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: # See https://github.com/golangci/golangci-lint-action for more details. uses: golangci/golangci-lint-action@v2.5.2 with: - version: v1.32 + version: v1.39 test: strategy: matrix: diff --git a/.golangci.yml b/.golangci.yml index 85aa27e..6f98f45 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -33,6 +33,7 @@ linters: - dupl - errcheck - exhaustive + - exportloopref - gochecknoinits - goconst - gocritic @@ -49,13 +50,11 @@ linters: - gosimple - govet - ineffassign - - interfacer - lll - misspell - nakedret - noctx - nolintlint - - scopelint - staticcheck - structcheck - stylecheck @@ -147,4 +146,4 @@ run: deadline: 15m service: - golangci-lint-version: 1.32.x + golangci-lint-version: 1.39.x