From 7eae69f10c28909f6f8325540f8d0326277e7fab Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 8 Dec 2020 15:05:59 +0100 Subject: [PATCH] cleanup: return error type in rbdGetDeviceList() Signed-off-by: Niels de Vos --- internal/rbd/rbd_attach.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rbd/rbd_attach.go b/internal/rbd/rbd_attach.go index 7ce3d6cb7..7d6f7995e 100644 --- a/internal/rbd/rbd_attach.go +++ b/internal/rbd/rbd_attach.go @@ -87,7 +87,7 @@ func rbdGetDeviceList(ctx context.Context, accessType string) ([]rbdDeviceInfo, stdout, _, err := util.ExecCommand(ctx, rbd, "device", "list", "--format="+"json", "--device-type", accessType) if err != nil { - return nil, fmt.Errorf("error getting device list from rbd for devices of type (%s): (%v)", accessType, err) + return nil, fmt.Errorf("error getting device list from rbd for devices of type (%s): %w", accessType, err) } if accessType == accessTypeKRbd { @@ -96,7 +96,7 @@ func rbdGetDeviceList(ctx context.Context, accessType string) ([]rbdDeviceInfo, err = json.Unmarshal([]byte(stdout), &nbdDeviceList) } if err != nil { - return nil, fmt.Errorf("error to parse JSON output of device list for devices of type (%s): (%v)", accessType, err) + return nil, fmt.Errorf("error to parse JSON output of device list for devices of type (%s): %w", accessType, err) } // convert output to a rbdDeviceInfo list for consumers