diff --git a/console.go b/console.go index 9085d8f..1c81441 100644 --- a/console.go +++ b/console.go @@ -88,9 +88,6 @@ func NewFileSerialPortAttachment(path string, shouldAppend bool) (*FileSerialPor if macosMajorVersionLessThan(11) { return nil, ErrUnsupportedOSVersion } - if _, err := os.Stat(path); err != nil { - return nil, err - } cpath := charWithGoString(path) defer cpath.Free() diff --git a/issues_test.go b/issues_test.go index 95eb3fa..f7c48c4 100644 --- a/issues_test.go +++ b/issues_test.go @@ -93,13 +93,8 @@ func TestIssue43(t *testing.T) { }) cases := map[string]func() error{ - // This is also fixed issue #71 - "NewFileSerialPortAttachment": func() error { - _, err := NewFileSerialPortAttachment(doesNotExists, false) - return err - }, "NewSharedDirectory": func() error { - _, err := NewFileSerialPortAttachment(doesNotExists, false) + _, err := NewSharedDirectory(doesNotExists, false) return err }, "NewDiskImageStorageDeviceAttachment": func() error { @@ -113,7 +108,7 @@ func TestIssue43(t *testing.T) { if err == nil { t.Fatal("expected returns error") } - if !errors.Is(err, os.ErrNotExist) { + if !errors.Is(err, ErrUnsupportedOSVersion) && !errors.Is(err, os.ErrNotExist) { t.Errorf("want underlying error %q but got %q", os.ErrNotExist, err) } })