From 21aee3dfe51e4e1b3310c1d2068f7ebd1aafd50b Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 24 Sep 2016 03:01:12 +0200 Subject: Return err with NewDevice --- device_linux.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'device_linux.go') diff --git a/device_linux.go b/device_linux.go index 912e34d..f6b2c6e 100644 --- a/device_linux.go +++ b/device_linux.go @@ -1,11 +1,5 @@ package robo -import "log" - -func NewDevice() Device { - dev, err := NewLP("/dev/usb/lp0") - if err != nil { - log.Fatal(err) - } - return dev +func NewDevice() (Device, error) { + return NewLP("/dev/usb/lp0") } -- cgit v1.2.3