@@ -47,11 +47,11 @@ var _ remote.RemoteConn = (*ADBConnection)(nil)
4747const username = "arduino"
4848
4949var (
50- // NotFoundErr is returned when the ADB device is not found.
51- NotFoundErr = fmt .Errorf ("ADB device not found" )
52- // DeviceOfflineErr is returned when the ADB device is not reachable.
50+ // ErrNotFound is returned when the ADB device is not found.
51+ ErrNotFound = fmt .Errorf ("ADB device not found" )
52+ // ErrDeviceOffline is returned when the ADB device is not reachable.
5353 // This usually requires a restart of the adbd server daemon on the device.
54- DeviceOfflineErr = fmt .Errorf ("ADB device is offline" )
54+ ErrDeviceOffline = fmt .Errorf ("ADB device is offline" )
5555)
5656
5757// FromSerial creates an ADBConnection from a device serial number.
@@ -70,9 +70,9 @@ func FromSerial(serial string, adbPath string) (*ADBConnection, error) {
7070 output , err := cmd .RunAndCaptureCombinedOutput (context .TODO ())
7171 if err != nil {
7272 if bytes .Contains (output , []byte ("device offline" )) {
73- return false , DeviceOfflineErr
73+ return false , ErrDeviceOffline
7474 } else if bytes .Contains (output , []byte ("not found" )) {
75- return false , NotFoundErr
75+ return false , ErrNotFound
7676 }
7777 return false , fmt .Errorf ("failed to get ADB device state: %w: %s" , err , output )
7878 }
0 commit comments