mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
cleanup: use wrapped static errors instead of dynamic
In Go 1.13, the fmt.Errorf function supports a new %w verb. When this verb is present, the error returned by fmt.Errorf will have an Unwrap method returning the argument of %w, which must be an error. In all other ways, %w is identical to %v. Updates: #1227 Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
@ -53,14 +53,14 @@ func getCredentialsForVolume(volOptions *volumeOptions, req *csi.NodeStageVolume
|
||||
|
||||
cr, err = util.NewAdminCredentials(secrets)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get admin credentials from node stage secrets: %v", err)
|
||||
return nil, fmt.Errorf("failed to get admin credentials from node stage secrets: %w", err)
|
||||
}
|
||||
} else {
|
||||
// The volume is pre-made, credentials are in node stage secrets
|
||||
|
||||
cr, err = util.NewUserCredentials(req.GetSecrets())
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get user credentials from node stage secrets: %v", err)
|
||||
return nil, fmt.Errorf("failed to get user credentials from node stage secrets: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user