Added MultiReader support for stderr
This commit is contained in:
parent
91f34866e0
commit
44d95ae99b
@ -40,6 +40,11 @@ func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup)
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
stdout, err := build.StdoutPipe()
|
stdout, err := build.StdoutPipe()
|
||||||
|
stderr, err := build.StderrPipe()
|
||||||
|
|
||||||
|
// Read stdout and stderr in same var
|
||||||
|
outputs := io.MultiReader(stdout, stderr)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(Red(err.Error()))
|
log.Println(Red(err.Error()))
|
||||||
return err
|
return err
|
||||||
@ -50,7 +55,7 @@ func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup)
|
|||||||
}
|
}
|
||||||
close(runner)
|
close(runner)
|
||||||
|
|
||||||
in := bufio.NewScanner(stdout)
|
in := bufio.NewScanner(outputs)
|
||||||
go func() {
|
go func() {
|
||||||
for in.Scan() {
|
for in.Scan() {
|
||||||
select {
|
select {
|
||||||
|
Loading…
Reference in New Issue
Block a user