mirror of
https://github.com/vmware-tanzu/velero.git
synced 2025-12-23 14:25:22 +00:00
golangci-lint: fix gosimple linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -360,7 +360,6 @@ issues:
|
|||||||
- errcheck
|
- errcheck
|
||||||
- goconst
|
- goconst
|
||||||
- gosec
|
- gosec
|
||||||
- gosimple
|
|
||||||
- nilerr
|
- nilerr
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- stylecheck
|
- stylecheck
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ func (c *CSIDataMoverVolumeInfo) Verify() error {
|
|||||||
BackupObjectsPrefix+"/"+c.BackupName,
|
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])
|
fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0])
|
||||||
Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true))
|
Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true))
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func (c *CSISnapshotVolumeInfo) Verify() error {
|
|||||||
BackupObjectsPrefix+"/"+c.BackupName,
|
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])
|
fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0])
|
||||||
Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true))
|
Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true))
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func (f *FilesystemUploadVolumeInfo) Verify() error {
|
|||||||
BackupObjectsPrefix+"/"+f.BackupName,
|
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])
|
fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0])
|
||||||
Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true))
|
Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true))
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ func (s *SkippedVolumeInfo) Verify() error {
|
|||||||
BackupObjectsPrefix+"/"+s.BackupName,
|
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])
|
fmt.Printf("The VolumeInfo metadata content: %+v\n", *volumeInfo[0])
|
||||||
Expect(len(volumeInfo) > 0).To(BeIdenticalTo(true))
|
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
|
// Clean SC and VSC
|
||||||
return s.cleanResource()
|
return s.cleanResource()
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ package backup
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -48,7 +47,7 @@ func (b *BackupTest) Init() error {
|
|||||||
b.TestMsg = &TestMSG{
|
b.TestMsg = &TestMSG{
|
||||||
Desc: "Do backup resources for performance test",
|
Desc: "Do backup resources for performance test",
|
||||||
FailedMSG: "Failed to backup resources",
|
FailedMSG: "Failed to backup resources",
|
||||||
Text: fmt.Sprintf("Should backup resources success"),
|
Text: "Should backup resources success",
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ package restore
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@@ -42,7 +41,7 @@ func (r *RestoreTest) Init() error {
|
|||||||
r.TestMsg = &TestMSG{
|
r.TestMsg = &TestMSG{
|
||||||
Desc: "Do restore resources for performance test",
|
Desc: "Do restore resources for performance test",
|
||||||
FailedMSG: "Failed to restore resources",
|
FailedMSG: "Failed to restore resources",
|
||||||
Text: fmt.Sprintf("Should restore resources success"),
|
Text: "Should restore resources success",
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user