From 736fbaeaba9c57b2f624a42808fc524f306b1591 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 27 Jan 2018 03:58:08 +0100 Subject: export rw --- console/console.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'console/console.go') 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 } -- cgit v1.2.3