From 6b1c02b9836a810b7ee1f7d53d1a0fc5da504746 Mon Sep 17 00:00:00 2001
From: Sebastiaan van Stijn <github@gone.nl>
Date: Sat, 3 Sep 2022 23:20:23 +0200
Subject: [PATCH] golangci-lint: update to v1.49.0

Remove the "deadcode", "structcheck", and "varcheck" linters, as they are
deprecated:

    WARN [runner] The linter 'deadcode' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [runner] The linter 'structcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [runner] The linter 'varcheck' is deprecated (since v1.49.0) due to: The owner seems to have abandoned the linter.  Replaced by unused.
    WARN [linters context] structcheck is disabled because of generics. You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 2f1c382a6ddb988cf968c0eac1c2c0884826e214)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3ce520ec8038cf322bea1f6d6fb31527172e1b89)
Signed-off-by: Cory Snider <csnider@mirantis.com>
---
 daemon/graphdriver/vfs/quota_linux.go           | 1 -
 hack/dockerfile/install/golangci_lint.installer | 2 +-
 hack/validate/golangci-lint.yml                 | 9 +++++----
 pkg/devicemapper/devmapper.go                   | 2 +-
 volume/drivers/extpoint.go                      | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/daemon/graphdriver/vfs/quota_linux.go b/daemon/graphdriver/vfs/quota_linux.go
index 372cbbb769..0a5caa754b 100644
--- a/daemon/graphdriver/vfs/quota_linux.go
+++ b/daemon/graphdriver/vfs/quota_linux.go
@@ -5,7 +5,6 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
-//nolint:structcheck
 type driverQuota struct {
 	quotaCtl *quota.Control
 	quotaOpt quota.Quota
diff --git a/hack/dockerfile/install/golangci_lint.installer b/hack/dockerfile/install/golangci_lint.installer
index c6f4b44d16..68785f18b5 100755
--- a/hack/dockerfile/install/golangci_lint.installer
+++ b/hack/dockerfile/install/golangci_lint.installer
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-: "${GOLANGCI_LINT_VERSION=v1.46.2}"
+: "${GOLANGCI_LINT_VERSION=v1.49.0}"
 
 install_golangci_lint() {
 	set -e
diff --git a/hack/validate/golangci-lint.yml b/hack/validate/golangci-lint.yml
index d3b0d5fae4..815300506c 100644
--- a/hack/validate/golangci-lint.yml
+++ b/hack/validate/golangci-lint.yml
@@ -1,6 +1,5 @@
 linters:
   enable:
-    - deadcode
     - goimports
     - gosec
     - gosimple
@@ -9,11 +8,9 @@ linters:
     - misspell
     - revive
     - staticcheck
-    - structcheck
     - typecheck
     - unconvert
     - unused
-    - varcheck
 
   disable:
     - errcheck
@@ -28,7 +25,11 @@ linters:
 linters-settings:
   govet:
     check-shadowing: false
-
+  revive:
+    rules:
+      # FIXME make sure all packages have a description. Currently, there's many packages without.
+      - name: package-comments
+        disabled: true
 issues:
   # The default exclusion rules are a bit too permissive, so copying the relevant ones below
   exclude-use-default: false
diff --git a/pkg/devicemapper/devmapper.go b/pkg/devicemapper/devmapper.go
index 034d6c2075..38cba829d0 100644
--- a/pkg/devicemapper/devmapper.go
+++ b/pkg/devicemapper/devmapper.go
@@ -16,7 +16,7 @@ import (
 
 // Same as DM_DEVICE_* enum values from libdevmapper.h
 //
-//nolint:deadcode,unused,varcheck
+//nolint:unused
 const (
 	deviceCreate TaskType = iota
 	deviceReload
diff --git a/volume/drivers/extpoint.go b/volume/drivers/extpoint.go
index 7a909130df..46a438612e 100644
--- a/volume/drivers/extpoint.go
+++ b/volume/drivers/extpoint.go
@@ -22,7 +22,7 @@ const extName = "VolumeDriver"
 // This interface is only defined to generate the proxy objects.
 // It's not intended to be public or reused.
 //
-//nolint:deadcode,unused,varcheck
+//nolint:unused
 type volumeDriver interface {
 	// Create a volume with the given name
 	Create(name string, opts map[string]string) (err error)