From a9b9d088463c0e26f11b7d4dd2a285e9f718eccc Mon Sep 17 00:00:00 2001
From: k8s-infra-cherrypick-robot
 <90416843+k8s-infra-cherrypick-robot@users.noreply.github.com>
Date: Wed, 18 Sep 2024 04:00:45 -0700
Subject: [PATCH] Bump golangci to 1.61 (#2664)

Co-authored-by: kayrus <kay.diam@gmail.com>
---
 .golangci.yaml                            | 5 ++++-
 Makefile                                  | 2 +-
 cmd/manila-csi-plugin/main.go             | 2 +-
 pkg/util/blockdevice/blockdevice_linux.go | 6 +++---
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/.golangci.yaml b/.golangci.yaml
index 69974fd2e4..4fb7bff04c 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -1,7 +1,10 @@
 run:
+  concurrency: 2
   timeout: 10m0s
 linters:
   enable:
     - gofmt
 output:
-  format: line-number
+  formats:
+    - format: line-number
+      path: stdout
diff --git a/Makefile b/Makefile
index d055a45f26..27798893e3 100644
--- a/Makefile
+++ b/Makefile
@@ -81,7 +81,7 @@ $(BUILD_CMDS): $(SOURCES)
 test: unit functional
 
 check: work
-	go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.0 run ./...
+	go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run ./...
 
 unit: work
 	go test -tags=unit $(shell go list ./... | sed -e '/sanity/ { N; d; }' | sed -e '/tests/ {N; d;}') $(TESTARGS)
diff --git a/cmd/manila-csi-plugin/main.go b/cmd/manila-csi-plugin/main.go
index 0c0b1895bb..b68217dce0 100644
--- a/cmd/manila-csi-plugin/main.go
+++ b/cmd/manila-csi-plugin/main.go
@@ -71,7 +71,7 @@ func main() {
 		Short: "CSI Manila driver",
 		Run: func(cmd *cobra.Command, args []string) {
 			if err := validateShareProtocolSelector(protoSelector); err != nil {
-				klog.Fatalf(err.Error())
+				klog.Fatal(err.Error())
 			}
 
 			manilaClientBuilder := &manilaclient.ClientBuilder{UserAgent: "manila-csi-plugin", ExtraUserAgentData: userAgentData}
diff --git a/pkg/util/blockdevice/blockdevice_linux.go b/pkg/util/blockdevice/blockdevice_linux.go
index a043f7012e..f9c8bdf02b 100644
--- a/pkg/util/blockdevice/blockdevice_linux.go
+++ b/pkg/util/blockdevice/blockdevice_linux.go
@@ -41,7 +41,7 @@ func findBlockDeviceRescanPath(path string) (string, error) {
 	if len(parts) == 3 && strings.HasPrefix(parts[1], "dev") {
 		return filepath.EvalSymlinks(filepath.Join("/sys/block", parts[2], "device", "rescan"))
 	}
-	return "", fmt.Errorf("illegal path for device " + devicePath)
+	return "", fmt.Errorf("illegal path for device %s", devicePath)
 }
 
 // IsBlockDevice checks whether device on the path is a block device
@@ -128,13 +128,13 @@ func RescanBlockDeviceGeometry(devicePath string, deviceMountPath string, newSiz
 func RescanDevice(devicePath string) error {
 	blockDeviceRescanPath, err := findBlockDeviceRescanPath(devicePath)
 	if err != nil {
-		return fmt.Errorf("Device does not have rescan path " + devicePath)
+		return fmt.Errorf("Device does not have rescan path %s", devicePath)
 	}
 
 	klog.V(3).Infof("Resolved block device path from %q to %q", devicePath, blockDeviceRescanPath)
 	err = triggerRescan(blockDeviceRescanPath)
 	if err != nil {
-		return fmt.Errorf("Error rescanning new block device geometry " + devicePath)
+		return fmt.Errorf("Error rescanning new block device geometry %s", devicePath)
 	}
 	return nil
 }