From 75fe7610619c6ff395e95183349d3801022a7ce8 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 28 Mar 2024 18:12:41 +0000 Subject: [PATCH] golangci-lint: fix gosimple linter Signed-off-by: Matthieu MOREL --- .golangci.yaml | 1 - test/e2e/basic/backup-volume-info/csi_data_mover.go | 2 +- test/e2e/basic/backup-volume-info/csi_snapshot.go | 2 +- test/e2e/basic/backup-volume-info/filesystem_upload.go | 2 +- test/e2e/basic/backup-volume-info/skipped_volumes.go | 4 ++-- test/perf/backup/backup.go | 3 +-- test/perf/restore/restore.go | 3 +-- 7 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.golangci.yaml b/.golangci.yaml index b6793233e7..8bd3caa9e6 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -360,7 +360,6 @@ issues: - errcheck - goconst - gosec - - gosimple - nilerr - staticcheck - stylecheck diff --git a/test/e2e/basic/backup-volume-info/csi_data_mover.go b/test/e2e/basic/backup-volume-info/csi_data_mover.go index a93f4a60c2..7e08114b5c 100644 --- a/test/e2e/basic/backup-volume-info/csi_data_mover.go +++ b/test/e2e/basic/backup-volume-info/csi_data_mover.go @@ -55,7 +55,7 @@ func (c *CSIDataMoverVolumeInfo) Verify() error { BackupObjectsPrefix+"/"+c.BackupName, ) - Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("Fail to get VolumeInfo metadata in the Backup Repository.")) + Expect(err).ShouldNot(HaveOccurred(), "Fail to get VolumeInfo metadata in the Backup Repository.") fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0]) Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true)) diff --git a/test/e2e/basic/backup-volume-info/csi_snapshot.go b/test/e2e/basic/backup-volume-info/csi_snapshot.go index a8d5669dbe..0bc3a7111b 100644 --- a/test/e2e/basic/backup-volume-info/csi_snapshot.go +++ b/test/e2e/basic/backup-volume-info/csi_snapshot.go @@ -54,7 +54,7 @@ func (c *CSISnapshotVolumeInfo) Verify() error { BackupObjectsPrefix+"/"+c.BackupName, ) - Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("Fail to get VolumeInfo metadata in the Backup Repository.")) + Expect(err).ShouldNot(HaveOccurred(), "Fail to get VolumeInfo metadata in the Backup Repository.") fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0]) Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true)) diff --git a/test/e2e/basic/backup-volume-info/filesystem_upload.go b/test/e2e/basic/backup-volume-info/filesystem_upload.go index 99323610f1..bab85ca126 100644 --- a/test/e2e/basic/backup-volume-info/filesystem_upload.go +++ b/test/e2e/basic/backup-volume-info/filesystem_upload.go @@ -54,7 +54,7 @@ func (f *FilesystemUploadVolumeInfo) Verify() error { BackupObjectsPrefix+"/"+f.BackupName, ) - Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("Fail to get VolumeInfo metadata in the Backup Repository.")) + Expect(err).ShouldNot(HaveOccurred(), "Fail to get VolumeInfo metadata in the Backup Repository.") fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0]) Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true)) diff --git a/test/e2e/basic/backup-volume-info/skipped_volumes.go b/test/e2e/basic/backup-volume-info/skipped_volumes.go index 0382619a32..f6fc2e226b 100644 --- a/test/e2e/basic/backup-volume-info/skipped_volumes.go +++ b/test/e2e/basic/backup-volume-info/skipped_volumes.go @@ -54,11 +54,11 @@ func (s *SkippedVolumeInfo) Verify() error { BackupObjectsPrefix+"/"+s.BackupName, ) - Expect(err).ShouldNot(HaveOccurred(), fmt.Sprintf("Fail to get VolumeInfo metadata in the Backup Repository.")) + Expect(err).ShouldNot(HaveOccurred(), "Fail to get VolumeInfo metadata in the Backup Repository.") fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0]) Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true)) - Expect(volumeInfo[0].Skipped == true).To(BeIdenticalTo(true)) + Expect(volumeInfo[0].Skipped).To(BeIdenticalTo(true)) // Clean SC and VSC return s.cleanResource() diff --git a/test/perf/backup/backup.go b/test/perf/backup/backup.go index 3a3c059a56..c8c39a6e1b 100644 --- a/test/perf/backup/backup.go +++ b/test/perf/backup/backup.go @@ -18,7 +18,6 @@ package backup import ( "context" - "fmt" "strings" "time" @@ -48,7 +47,7 @@ func (b *BackupTest) Init() error { b.TestMsg = &TestMSG{ Desc: "Do backup resources for performance test", FailedMSG: "Failed to backup resources", - Text: fmt.Sprintf("Should backup resources success"), + Text: "Should backup resources success", } return nil } diff --git a/test/perf/restore/restore.go b/test/perf/restore/restore.go index f07d5df4d6..6adbff5f4e 100644 --- a/test/perf/restore/restore.go +++ b/test/perf/restore/restore.go @@ -18,7 +18,6 @@ package restore import ( "context" - "fmt" "time" "github.com/pkg/errors" @@ -42,7 +41,7 @@ func (r *RestoreTest) Init() error { r.TestMsg = &TestMSG{ Desc: "Do restore resources for performance test", FailedMSG: "Failed to restore resources", - Text: fmt.Sprintf("Should restore resources success"), + Text: "Should restore resources success", } return nil }