From 44d95ae99b813605eecff62ca1fd3584a17b1707 Mon Sep 17 00:00:00 2001 From: Daniele Conventi Date: Tue, 23 Aug 2016 14:42:01 +0200 Subject: [PATCH] Added MultiReader support for stderr --- realize/project.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/realize/project.go b/realize/project.go index c65b434..f074e68 100644 --- a/realize/project.go +++ b/realize/project.go @@ -40,6 +40,11 @@ func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup) }() stdout, err := build.StdoutPipe() + stderr, err := build.StderrPipe() + + // Read stdout and stderr in same var + outputs := io.MultiReader(stdout, stderr) + if err != nil { log.Println(Red(err.Error())) return err @@ -50,7 +55,7 @@ func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup) } close(runner) - in := bufio.NewScanner(stdout) + in := bufio.NewScanner(outputs) go func() { for in.Scan() { select {