From 92af9f1b15a564c4c97152e249029b3ebcee393c Mon Sep 17 00:00:00 2001 From: Zach Klippenstein Date: Sat, 5 Sep 2015 22:44:36 -0700 Subject: [PATCH] Removed unused err return value from NewDeviceWatcher. --- cmd/demo/demo.go | 2 +- device_watcher.go | 4 ++-- host_client.go | 16 ---------------- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/cmd/demo/demo.go b/cmd/demo/demo.go index 023dba3..17a5d6c 100644 --- a/cmd/demo/demo.go +++ b/cmd/demo/demo.go @@ -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) } diff --git a/device_watcher.go b/device_watcher.go index 3f97335..df2e0ad 100644 --- a/device_watcher.go +++ b/device_watcher.go @@ -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 } /* diff --git a/host_client.go b/host_client.go index fd8c7a1..c74126e 100644 --- a/host_client.go +++ b/host_client.go @@ -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()} }