Skip to content

Commit 458d15c

Browse files
Luap99TomSweeneyRedHat
authored andcommitted
[v5.2] 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 <[email protected]> Signed-off-by: tomsweeneyredhat <[email protected]>
1 parent faf3edb commit 458d15c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/machine/apple/vfkit/helper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ func (vf *Helper) Stop(force, wait bool) error {
102102
// Wait up to 90s then hard force off
103103
for i := 0; i < 180; i++ {
104104
_, err := vf.getRawState()
105-
if err != nil || errors.Is(err, unix.ECONNREFUSED) {
105+
if err != nil {
106+
//nolint:nilerr // error means vfkit is gone so machine is stopped
106107
return nil
107108
}
108109
time.Sleep(waitDuration)

0 commit comments

Comments
 (0)