From 96e541427ef7e6b61092c60234813c780837534f Mon Sep 17 00:00:00 2001 From: Burcu Dogan Date: Thu, 2 Apr 2015 15:42:08 -0700 Subject: [PATCH] mobile/sensor: don't panic, return an availability error on non-android Change-Id: I42152d6fd5af220a780a6e3a288a97551ee53f39 Reviewed-on: https://go-review.googlesource.com/8413 Reviewed-by: Hyang-Ah Hana Kim --- sensor/sensor_notandroid.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sensor/sensor_notandroid.go b/sensor/sensor_notandroid.go index 7a8d14b..5a05ce8 100644 --- a/sensor/sensor_notandroid.go +++ b/sensor/sensor_notandroid.go @@ -6,27 +6,29 @@ package sensor -import "time" +import ( + "errors" + "time" +) type manager struct { } func (m *manager) initialize() { - panic("not implemented") } func (m *manager) enable(t Type, delay time.Duration) error { - panic("not implemented") + return errors.New("sensor: no sensors available") } func (m *manager) disable(t Type) error { - panic("not implemented") + return errors.New("sensor: no sensors available") } func (m *manager) read(e []Event) (n int, err error) { - panic("not implemented") + return 0, errors.New("sensor: no sensor data available") } func (m *manager) close() error { - panic("not implemented") + return nil }