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:
Paul Holzinger
2024-08-15 15:22:53 +02:00
parent 666d839157
commit 84a85319e1

View File

@ -102,7 +102,8 @@ func (vf *Helper) Stop(force, wait bool) error {
// Wait up to 90s then hard force off
for i := 0; i < 180; i++ {
_, 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
}
time.Sleep(waitDuration)