cleanup: use err and target in recommended order to errors.Is()

The documentation has `error.Is(err, target)`, so use this as the order
of the parameters.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit is contained in:
Niels de Vos 2024-10-02 17:11:43 +02:00 committed by mergify[bot]
parent 3802dd2c2c
commit e154eae732

View File

@ -187,7 +187,7 @@ func (vg *volumeGroup) Delete(ctx context.Context) error {
}
err = librbd.GroupRemove(ioctx, name)
if err != nil && !errors.Is(rados.ErrNotFound, err) {
if err != nil && !errors.Is(err, rados.ErrNotFound) {
return fmt.Errorf("failed to remove volume group %q: %w", vg, err)
}
@ -245,7 +245,7 @@ func (vg *volumeGroup) RemoveVolume(ctx context.Context, vol types.Volume) error
err := vol.RemoveFromGroup(ctx, vg)
if err != nil {
if errors.Is(librbd.ErrNotExist, err) {
if errors.Is(err, librbd.ErrNotExist) {
return nil
}