Merge pull request #7592 from mmorel-35/gosimple

golangci-lint(gosimple): fix test files
pull/7623/head
Xun Jiang/Bruce Jiang 2024-05-27 11:14:42 +08:00 committed by GitHub
commit c8e252cfac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 7 additions and 10 deletions

View File

@ -360,7 +360,6 @@ issues:
- errcheck
- goconst
- gosec
- gosimple
- nilerr
- staticcheck
- stylecheck

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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()

View File

@ -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
}

View File

@ -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
}