Skip to content

Commit 1b6065d

Browse files
committed
Removed redundant elses
Signed-off-by: Anes Hasicic <anes.hasicic@gmail.com>
1 parent 3d9cbf0 commit 1b6065d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/devicemapper/devmapper.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,9 +586,10 @@ func CreateDevice(poolName string, deviceId int) error {
586586
// Caller wants to know about ErrDeviceIdExists so that it can try with a different device id.
587587
if dmSawExist {
588588
return ErrDeviceIdExists
589-
} else {
590-
return fmt.Errorf("Error running CreateDevice %s", err)
591589
}
590+
591+
return fmt.Errorf("Error running CreateDevice %s", err)
592+
592593
}
593594
return nil
594595
}
@@ -681,9 +682,10 @@ func CreateSnapDevice(poolName string, deviceId int, baseName string, baseDevice
681682
// Caller wants to know about ErrDeviceIdExists so that it can try with a different device id.
682683
if dmSawExist {
683684
return ErrDeviceIdExists
684-
} else {
685-
return fmt.Errorf("Error running DeviceCreate (createSnapDevice) %s", err)
686685
}
686+
687+
return fmt.Errorf("Error running DeviceCreate (createSnapDevice) %s", err)
688+
687689
}
688690

689691
if doSuspend {

0 commit comments

Comments
 (0)