From 1e58b4cabdcbd0fd4a62b2353cd3269495047f7b Mon Sep 17 00:00:00 2001 From: Ryotaro Banno Date: Fri, 25 Oct 2024 05:40:44 +0000 Subject: [PATCH] use golangci-lint v1.61.0 Signed-off-by: Ryotaro Banno --- .golangci.yml | 2 +- internal/controller/mantlebackup_controller.go | 2 -- test/e2e/singlek8s/backup_test.go | 2 +- test/e2e/singlek8s/multi_rook_ceph_test.go | 3 +-- test/e2e/singlek8s/restore_test.go | 2 +- versions.mk | 2 +- 6 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index aed8644d..0f051a6c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -21,7 +21,7 @@ linters: enable: - dupl - errcheck - - exportloopref + - copyloopvar - goconst - gocyclo - gofmt diff --git a/internal/controller/mantlebackup_controller.go b/internal/controller/mantlebackup_controller.go index c687687c..c6fd40aa 100644 --- a/internal/controller/mantlebackup_controller.go +++ b/internal/controller/mantlebackup_controller.go @@ -813,7 +813,6 @@ func (r *MantleBackupReconciler) prepareForDataSynchronization( func convertToMap(mantleBackups []mantlev1.MantleBackup) map[string]*mantlev1.MantleBackup { m := make(map[string]*mantlev1.MantleBackup) for _, mantleBackup := range mantleBackups { - mantleBackup := mantleBackup m[mantleBackup.GetName()] = &mantleBackup } return m @@ -826,7 +825,6 @@ func searchForDiffOriginMantleBackup( ) *mantlev1.MantleBackup { var diffOrigin *mantlev1.MantleBackup for _, primaryBackup := range primaryBackups { - primaryBackup := primaryBackup secondaryBackup, ok := secondaryBackupMap[primaryBackup.Name] if !ok { continue diff --git a/test/e2e/singlek8s/backup_test.go b/test/e2e/singlek8s/backup_test.go index ec25e53b..cae2d2e1 100644 --- a/test/e2e/singlek8s/backup_test.go +++ b/test/e2e/singlek8s/backup_test.go @@ -56,7 +56,7 @@ func backupTestSuite() { func (test *backupTest) setupEnv() { It("setting up the test environment", func() { - fmt.Fprintf(GinkgoWriter, "%+v\n", *test) + _, _ = fmt.Fprintf(GinkgoWriter, "%+v\n", *test) }) It("creating common resources", func() { diff --git a/test/e2e/singlek8s/multi_rook_ceph_test.go b/test/e2e/singlek8s/multi_rook_ceph_test.go index 04701305..e0ce62ed 100644 --- a/test/e2e/singlek8s/multi_rook_ceph_test.go +++ b/test/e2e/singlek8s/multi_rook_ceph_test.go @@ -40,7 +40,7 @@ func multiRookCephTestSuite() { func (test *multiRookCephTest) setupEnv() { It("setting up the test environment", func() { - fmt.Fprintf(GinkgoWriter, "%+v\n", *test) + _, _ = fmt.Fprintf(GinkgoWriter, "%+v\n", *test) }) It("creating common resources", func() { @@ -59,7 +59,6 @@ func (test *multiRookCephTest) setupEnv() { func (test *multiRookCephTest) teardownEnv() { for _, ns := range []string{test.tenantNamespace1, test.tenantNamespace2} { - ns := ns It("delete resources in the namespace: "+ns, func() { err := deleteNamespacedResource(ns, "mantlerestore") Expect(err).NotTo(HaveOccurred()) diff --git a/test/e2e/singlek8s/restore_test.go b/test/e2e/singlek8s/restore_test.go index 210865c1..813be194 100644 --- a/test/e2e/singlek8s/restore_test.go +++ b/test/e2e/singlek8s/restore_test.go @@ -52,7 +52,7 @@ func restoreTestSuite() { func (test *restoreTest) setupEnv() { It("describing the test environment", func() { - fmt.Fprintf(GinkgoWriter, "%+v\n", *test) + _, _ = fmt.Fprintf(GinkgoWriter, "%+v\n", *test) }) It("creating common resources", func() { diff --git a/versions.mk b/versions.mk index 3e705645..77f55563 100644 --- a/versions.mk +++ b/versions.mk @@ -15,7 +15,7 @@ PROTOC_VERSION := 28.3 # https://github.com/rook/rook/releases ROOK_CHART_VERSION := v1.15.4 # https://github.com/golangci/golangci-lint/releases -GOLANGCI_LINT_VERSION := v1.54.2 +GOLANGCI_LINT_VERSION := v1.61.0 # Tools versions which are defined in go.mod SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))