cleanup: use %w to format errors

Use %w instead of %v to format errors.

Updates: #1586

Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
Yati Padia
2021-06-25 16:49:37 +05:30
committed by mergify[bot]
parent d8e3a7a778
commit 7f7a41d23a
2 changed files with 4 additions and 4 deletions

View File

@ -33,11 +33,11 @@ func getSnapshot(path string) snapapi.VolumeSnapshot {
func newSnapshotClient() (*snapclient.SnapshotV1Client, error) {
config, err := framework.LoadConfig()
if err != nil {
return nil, fmt.Errorf("error creating client: %v", err.Error())
return nil, fmt.Errorf("error creating client: %w", err)
}
c, err := snapclient.NewForConfig(config)
if err != nil {
return nil, fmt.Errorf("error creating snapshot client: %v", err.Error())
return nil, fmt.Errorf("error creating snapshot client: %w", err)
}
return c, err
}