aboutsummaryrefslogtreecommitdiff
path: root/console/console.go
diff options
context:
space:
mode:
Diffstat (limited to 'console/console.go')
-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
}