Skip to content

Commit cae4b33

Browse files
committed
fix: disable libusb auto detach on osx
1 parent ee32b01 commit cae4b33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

printing/usb/usb.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"errors"
88
"fmt"
99
"image"
10+
"runtime"
1011
"strconv"
1112
"strings"
1213
"sync"
@@ -88,8 +89,10 @@ func (c *USB) openDevice(vendor int64, product int64, endpoint int) error {
8889
return err
8990
}
9091

91-
if err := device.SetAutoDetach(true); err != nil {
92-
return err
92+
if runtime.GOOS != "darwin" {
93+
if err := device.SetAutoDetach(true); err != nil {
94+
return err
95+
}
9396
}
9497

9598
iface, done, err := device.DefaultInterface()

0 commit comments

Comments
 (0)