Removed unused err return value from NewDeviceWatcher.

This commit is contained in:
Zach Klippenstein 2015-09-05 22:44:36 -07:00
parent a92512cf8f
commit 92af9f1b15
3 changed files with 3 additions and 19 deletions

View file

@ -51,7 +51,7 @@ func main() {
fmt.Println()
fmt.Println("Watching for device state changes.")
watcher, err := adb.NewDeviceWatcher(adb.ClientConfig{})
watcher := adb.NewDeviceWatcher(adb.ClientConfig{})
for event := range watcher.C() {
fmt.Printf("\t[%s]%+v\n", time.Now(), event)
}

View file

@ -36,7 +36,7 @@ type deviceWatcherImpl struct {
startServer func() error
}
func NewDeviceWatcher(config ClientConfig) (*DeviceWatcher, error) {
func NewDeviceWatcher(config ClientConfig) *DeviceWatcher {
watcher := &DeviceWatcher{&deviceWatcherImpl{
config: config.sanitized(),
eventChan: make(chan DeviceStateChangedEvent),
@ -49,7 +49,7 @@ func NewDeviceWatcher(config ClientConfig) (*DeviceWatcher, error) {
go publishDevices(watcher.deviceWatcherImpl)
return watcher, nil
return watcher
}
/*

View file

@ -14,7 +14,6 @@ Eg.
client := NewHostClient()
client.StartServer()
client.ListDevices()
client.GetAnyDevice() // see DeviceClient
See list of services at https://android.googlesource.com/platform/system/core/+/master/adb/SERVICES.TXT.
*/
@ -23,21 +22,6 @@ type HostClient struct {
config ClientConfig
}
// func NewHostClient() (*HostClient, error) {
// return NewHostClientPort(AdbPort)
// }
// func NewHostClientPort(port int) (*HostClient, error) {
// return NewHostClientDialer(wire.NewDialer("localhost", port))
// }
// func NewHostClientDialer(d wire.Dialer) (*HostClient, error) {
// if d == nil {
// return nil, errors.New("dialer cannot be nil.")
// }
// return &HostClient{d}, nil
// }
func NewHostClient(config ClientConfig) *HostClient {
return &HostClient{config.sanitized()}
}