aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-15 17:44:18 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-15 17:44:18 +0200
commit0d794ada3be092678430077991b323472214e44c (patch)
tree349c18a081fa0dbe00d8b0a05a0a3aee2b43759d
parent6d305ebe1e4086329bcaa137b44a5f452cbd7193 (diff)
Refactor Device
-rw-r--r--device.go2
-rw-r--r--lp.go2
-rw-r--r--main.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/device.go b/device.go
index ea8c416..eff1333 100644
--- a/device.go
+++ b/device.go
@@ -2,7 +2,7 @@ package main
import "bufio"
-type Devicer interface {
+type Device interface {
Close()
Handle() *bufio.ReadWriter
}
diff --git a/lp.go b/lp.go
index 2a36f07..e4ab27c 100644
--- a/lp.go
+++ b/lp.go
@@ -9,7 +9,7 @@ type LP struct {
*os.File
}
-func NewLP(path string) (Devicer, error) {
+func NewLP(path string) (LP, error) {
f, err := os.OpenFile(path, os.O_RDWR, 0666)
return LP{f}, err
}
diff --git a/main.go b/main.go
index 16aa8f7..f2c671c 100644
--- a/main.go
+++ b/main.go
@@ -7,7 +7,7 @@ import (
)
var (
- dev Devicer
+ dev Device
err error
cmd = flag.String("cmd", "", "command")
)