From 1ac751b20c8c6efe924737b0f88b9de6805bd5b4 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Sat, 4 Oct 2014 19:53:11 -0500 Subject: step0_repl.go: strip newline from input. --- go/step0_repl.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/step0_repl.go b/go/step0_repl.go index 6e559c9..601ef64 100644 --- a/go/step0_repl.go +++ b/go/step0_repl.go @@ -5,6 +5,7 @@ import ( //"io" "fmt" "os" + "strings" ) // read @@ -33,6 +34,7 @@ func main() { for { fmt.Print("user> "); text, err := reader.ReadString('\n'); + text = strings.TrimRight(text, "\n"); if (err != nil) { return } -- cgit v1.2.3