From 59118b42b1c910e78f1612df32669cee7df21944 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 5 Dec 2022 12:51:51 -0700 Subject: [PATCH] golangci-lint: remove three deprecated linters golangci-lint is throwing warnings on each run: WARN [runner] The linter 'xxxxx' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter. Replaced by unused. ...for xxxxx in deadcode, structcheck, varcheck. Add those three to the deprecated-linter list, and remove any exceptions from the code base. Signed-off-by: Ed Santiago --- .golangci.yml | 3 +++ pkg/api/handlers/swagger/errors.go | 2 +- pkg/api/handlers/swagger/models.go | 2 +- pkg/api/handlers/swagger/responses.go | 2 +- pkg/machine/e2e/config_init_test.go | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index cf0c2279d0..d98d1c409f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -62,6 +62,9 @@ linters: - golint # replaced by revive - scopelint # replaced by exportloopref - interfacer + - deadcode # deprecated since v1.49.0, replaced by unused + - structcheck # deprecated since v1.49.0, replaced by unused + - varcheck # deprecated since v1.49.0, replaced by unused linters-settings: errcheck: check-blank: false diff --git a/pkg/api/handlers/swagger/errors.go b/pkg/api/handlers/swagger/errors.go index 28e11c9fba..18308d1b7b 100644 --- a/pkg/api/handlers/swagger/errors.go +++ b/pkg/api/handlers/swagger/errors.go @@ -1,4 +1,4 @@ -//nolint:deadcode,unused // these types are used to wire generated swagger to API code +//nolint:unused // these types are used to wire generated swagger to API code package swagger import ( diff --git a/pkg/api/handlers/swagger/models.go b/pkg/api/handlers/swagger/models.go index a05e57dff5..2422b08b60 100644 --- a/pkg/api/handlers/swagger/models.go +++ b/pkg/api/handlers/swagger/models.go @@ -1,4 +1,4 @@ -//nolint:deadcode,unused // these types are used to wire generated swagger to API code +//nolint:unused // these types are used to wire generated swagger to API code package swagger import ( diff --git a/pkg/api/handlers/swagger/responses.go b/pkg/api/handlers/swagger/responses.go index 3de9b06e99..d97bde6dd8 100644 --- a/pkg/api/handlers/swagger/responses.go +++ b/pkg/api/handlers/swagger/responses.go @@ -1,4 +1,4 @@ -//nolint:deadcode,unused // these types are used to wire generated swagger to API code +//nolint:unused // these types are used to wire generated swagger to API code package swagger import ( diff --git a/pkg/machine/e2e/config_init_test.go b/pkg/machine/e2e/config_init_test.go index 305d101a39..43313ad2f9 100644 --- a/pkg/machine/e2e/config_init_test.go +++ b/pkg/machine/e2e/config_init_test.go @@ -27,7 +27,7 @@ type initMachine struct { memory *uint now bool timezone string - rootful bool //nolint:unused,structcheck + rootful bool //nolint:unused volumes []string cmd []string