aboutsummaryrefslogtreecommitdiff
path: root/console
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-27 03:58:08 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-27 03:58:08 +0100
commit736fbaeaba9c57b2f624a42808fc524f306b1591 (patch)
tree26752dd8097c234ae956e70be92f9cb14003f795 /console
parentd7c2fb9d4723464067d501d8e45fc7f9b0fc60fe (diff)
export rw
Diffstat (limited to 'console')
-rw-r--r--console/console.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/console/console.go b/console/console.go
index bbe366e..bfced03 100644
--- a/console/console.go
+++ b/console/console.go
@@ -3,7 +3,6 @@ package console
import (
"fmt"
"io"
- "os"
)
type Console struct {
@@ -11,14 +10,14 @@ type Console struct {
done chan struct{}
}
-func New() *Console {
+func New(w io.Writer, r io.Reader) *Console {
c := &Console{
ich: make(chan uint16, 1),
och: make(chan uint16, 1),
done: make(chan struct{}),
}
- go c.read(os.Stdin)
- go c.write(os.Stdout)
+ go c.write(w)
+ go c.read(r)
return c
}