From f3b7c5ea9b09431b5269fb1454715b9b79d10d43 Mon Sep 17 00:00:00 2001 From: Lukas Malkmus Date: Mon, 2 Jan 2017 19:54:44 +0100 Subject: [PATCH] Use term.Write() to write to console --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index c68af76..48ba0dd 100644 --- a/main.go +++ b/main.go @@ -58,10 +58,10 @@ func main() { res, err := compute.Evaluate(text) if err != nil { - fmt.Println("Error: " + err.Error()) + term.Write([]byte(fmt.Sprintln("Error: " + err.Error()))) continue } - fmt.Printf("%s\n", strconv.FormatFloat(res, 'G', -1, 64)) + term.Write([]byte(fmt.Sprintf("%s\n", strconv.FormatFloat(res, 'G', -1, 64)))) } }