mirror of
https://github.com/containers/podman.git
synced 2025-10-19 12:12:36 +08:00
golangci-lint: make darwin linting happy
Fix one minor issue with vfkit error handling. First checking if err != nil OR errors.Is() is pointless as the err != is already true. Second nilerr complains because we return nil when we hit an error branch, in this case this is correct because an error means VM is stopped. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -102,7 +102,8 @@ func (vf *Helper) Stop(force, wait bool) error {
|
|||||||
// Wait up to 90s then hard force off
|
// Wait up to 90s then hard force off
|
||||||
for i := 0; i < 180; i++ {
|
for i := 0; i < 180; i++ {
|
||||||
_, err := vf.getRawState()
|
_, err := vf.getRawState()
|
||||||
if err != nil || errors.Is(err, unix.ECONNREFUSED) {
|
if err != nil {
|
||||||
|
//nolint:nilerr // error means vfkit is gone so machine is stopped
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
time.Sleep(waitDuration)
|
time.Sleep(waitDuration)
|
||||||
|
Reference in New Issue
Block a user