From a9e9756a3e9542955e107e0d673cf783e6a37e44 Mon Sep 17 00:00:00 2001 From: Mario Zupan Date: Sun, 18 Jun 2017 14:27:24 +0200 Subject: [PATCH] Issue #3: fix color output on windows --- main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index bf0d24d..5cd1831 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "bufio" "flag" "fmt" + "github.com/fatih/color" "github.com/kardianos/osext" homedir "github.com/mitchellh/go-homedir" "github.com/zupzup/calories/command" @@ -126,13 +127,13 @@ func main() { if err != nil { fatalError(r, err) } - fmt.Println(res) + fmt.Fprintln(color.Output, res) } else { res, err := handleNoSubCommand(commandsFlag, outputFlag, ds, r, os.Args) if err != nil { fatalError(r, err) } - fmt.Println(res) + fmt.Fprintln(color.Output, res) } }