From e1a90ade4f89239471092a83942b412f0a3b58b6 Mon Sep 17 00:00:00 2001 From: SjB Date: Wed, 9 Apr 2014 00:09:13 -0400 Subject: [PATCH] Code cleanup in NewGPIODriver func. Don't assign the object to a variable just return it right away. --- gpiodriver.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gpiodriver.go b/gpiodriver.go index a555497..69d0516 100644 --- a/gpiodriver.go +++ b/gpiodriver.go @@ -34,7 +34,7 @@ type gpioDriver struct { // NewGPIODriver returns a GPIODriver interface which allows control // over the GPIO subsystem. func NewGPIODriver(pinMap PinMap, dpf digitalPinFactory, apf analogPinFactory, ppf pwmPinFactory) GPIODriver { - driver := &gpioDriver{ + return &gpioDriver{ pinMap: pinMap, dpf: dpf, apf: apf, @@ -43,7 +43,6 @@ func NewGPIODriver(pinMap PinMap, dpf digitalPinFactory, apf analogPinFactory, p watchEventCallbacks: map[int]InterruptPin{}, initializedPins: map[string]pin{}, } - return driver } var epollFD int