From 3f88b67361cf4a7d16950a98c66670a9eb0318a0 Mon Sep 17 00:00:00 2001 From: Karan Misra Date: Sun, 23 Mar 2014 06:41:51 +0530 Subject: [PATCH] minor cleanup --- bbb.go | 3 +-- descriptor.go | 3 ++- gpio.go | 2 +- i2c.go | 2 +- led.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bbb.go b/bbb.go index ce349af..aba077d 100644 --- a/bbb.go +++ b/bbb.go @@ -1,7 +1,6 @@ package embd import ( - "errors" "fmt" "io/ioutil" "os" @@ -189,7 +188,7 @@ func (p *bbbAnalogPin) Read() (int, error) { } func (p *bbbAnalogPin) Write(_ int) error { - return errors.New("gpio: not implemented") + return ErrFeatureNotImplemented } func (p *bbbAnalogPin) Close() error { diff --git a/descriptor.go b/descriptor.go index ffd4a96..5f1117a 100644 --- a/descriptor.go +++ b/descriptor.go @@ -29,4 +29,5 @@ func DescribeHost() (*Descriptor, error) { return describer(rev), nil } -var ErrFeatureNotSupport = errors.New("embd: feature is not supported") +var ErrFeatureNotSupported = errors.New("embd: requested feature is not supported") +var ErrFeatureNotImplemented = errors.New("embd: requested feature is not implemented") diff --git a/gpio.go b/gpio.go index 138cbf8..44b535e 100644 --- a/gpio.go +++ b/gpio.go @@ -52,7 +52,7 @@ func InitGPIO() error { } if desc.GPIODriver == nil { - return ErrFeatureNotSupport + return ErrFeatureNotSupported } gpioDriverInstance = desc.GPIODriver() diff --git a/i2c.go b/i2c.go index 29b8253..fd65e8f 100644 --- a/i2c.go +++ b/i2c.go @@ -38,7 +38,7 @@ func InitI2C() error { } if desc.I2CDriver == nil { - return ErrFeatureNotSupport + return ErrFeatureNotSupported } i2cDriverInstance = desc.I2CDriver() diff --git a/led.go b/led.go index 3c3483e..ec7897a 100644 --- a/led.go +++ b/led.go @@ -24,7 +24,7 @@ func InitLED() error { } if desc.LEDDriver == nil { - return ErrFeatureNotSupport + return ErrFeatureNotSupported } ledDriverInstance = desc.LEDDriver()