diff options
Diffstat (limited to 'go/src/step8_macros')
| -rw-r--r-- | go/src/step8_macros/step8_macros.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/go/src/step8_macros/step8_macros.go b/go/src/step8_macros/step8_macros.go index 6735275..82572d3 100644 --- a/go/src/step8_macros/step8_macros.go +++ b/go/src/step8_macros/step8_macros.go @@ -1,15 +1,14 @@ package main import ( - "bufio" - //"io" "fmt" - "os" "strings" "errors" + "os" ) import ( + "readline" . "types" "reader" "printer" @@ -259,11 +258,9 @@ func main() { os.Exit(0) } - rdr := bufio.NewReader(os.Stdin); // repl loop for { - fmt.Print("user> "); - text, err := rdr.ReadString('\n'); + text, err := readline.Readline("user> ") text = strings.TrimRight(text, "\n"); if (err != nil) { return |
