diff options
Diffstat (limited to 'go/src/step0_repl')
| -rw-r--r-- | go/src/step0_repl/step0_repl.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/go/src/step0_repl/step0_repl.go b/go/src/step0_repl/step0_repl.go index 1203213..2e4c47c 100644 --- a/go/src/step0_repl/step0_repl.go +++ b/go/src/step0_repl/step0_repl.go @@ -1,12 +1,14 @@ package main import ( - "bufio" "fmt" - "os" "strings" ) +import ( + "readline" +) + // read func READ(str string) string { return str @@ -28,11 +30,9 @@ func rep(str string) string { } func main() { - reader := bufio.NewReader(os.Stdin); // repl loop for { - fmt.Print("user> "); - text, err := reader.ReadString('\n'); + text, err := readline.Readline("user> ") text = strings.TrimRight(text, "\n"); if (err != nil) { return |
