From 157d0ef9774ba8704ffd0cb65c28e1f52f3c7545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 1 Jun 2024 08:26:44 +0300 Subject: [PATCH 1/2] Address golangci-lint linter deprecation warnings 1.59.0 outputs: WARN [lintersdb] The name "gas" is deprecated. The linter has been renamed to: gosec. WARN [lintersdb] The linter named "megacheck" is deprecated. It has been split into: gosimple, staticcheck, unused. --- .golangci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 7b6d30216..fd681d17a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,7 +26,6 @@ linters: - errcheck #- exhaustive #- funlen - - gas #- gochecknoinits - goconst - gocritic @@ -35,19 +34,18 @@ linters: - goimports #- gomnd #- goprintffuncname - #- gosec + - gosec - gosimple - govet - ineffassign #- lll - - megacheck #- misspell #- nakedret #- noctx #- nolintlint #- rowserrcheck #- scopelint - #- staticcheck + - staticcheck #- structcheck ! deprecated since v1.49.0; replaced by 'unused' - stylecheck #- typecheck From 17d4f8fc5d50b258e5fd6d6a3141327614572f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 1 Jun 2024 08:31:29 +0300 Subject: [PATCH 2/2] Enable some more linters, address finding --- .golangci.yml | 6 +++--- command.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index fd681d17a..2c8f4808c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -30,7 +30,7 @@ linters: - goconst - gocritic #- gocyclo - #- gofmt + - gofmt - goimports #- gomnd #- goprintffuncname @@ -39,10 +39,10 @@ linters: - govet - ineffassign #- lll - #- misspell + - misspell #- nakedret #- noctx - #- nolintlint + - nolintlint #- rowserrcheck #- scopelint - staticcheck diff --git a/command.go b/command.go index b31e22c86..54748fc67 100644 --- a/command.go +++ b/command.go @@ -1460,7 +1460,6 @@ func (c *Command) UseLine() string { // DebugFlags used to determine which flags have been assigned to which commands // and which persist. -// nolint:goconst func (c *Command) DebugFlags() { c.Println("DebugFlags called on", c.Name()) var debugflags func(*Command)