aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-01-07 01:36:10 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-01-07 01:36:10 +0100
commit7d6ee8d28f456561b2adb6d85f6c86bcbb44d353 (patch)
tree3501216049a7b382fd9121b42898baeac2eb7a54
parentce73ed1672d0aa79d8ad92942777ec9227c838f8 (diff)
kiss
-rw-r--r--console.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/console.go b/console.go
index 388b207..9ca2a70 100644
--- a/console.go
+++ b/console.go
@@ -1,19 +1,19 @@
package j1
import (
- "bufio"
+ "io"
"os"
)
type Console struct {
- r *bufio.Reader
- w *bufio.Writer
+ r io.Reader
+ w io.Writer
}
func NewConsole() *Console {
return &Console{
- r: bufio.NewReader(os.Stdin),
- w: bufio.NewWriter(os.Stdout),
+ r: os.Stdin,
+ w: os.Stdout,
}
}
@@ -26,9 +26,5 @@ func (c *Console) Read(p []byte) (int, error) {
}
func (c *Console) Write(p []byte) (int, error) {
- n, err := c.w.Write(p)
- if err != nil {
- return 0, err
- }
- return n, c.w.Flush()
+ return c.w.Write(p)
}