Commit beb80d2e authored by Timon Stampfli's avatar Timon Stampfli
Browse files

fixing go runner bug, which forgets to output

parent 551bfa6b
......@@ -4,6 +4,7 @@ import (
type sampleExecutionResult struct {
......@@ -32,10 +33,24 @@ func runSample(cmd string, input io.Reader, output, stderr io.Writer) sampleExec
var collectedStdin bytes.Buffer
var collectedStdout bytes.Buffer
var collectedStderr bytes.Buffer
go io.Copy(io.MultiWriter(processStdin, &collectedStdin), input)
go io.Copy(io.MultiWriter(output, &collectedStdout), processStdout)
go io.Copy(io.MultiWriter(stderr, &collectedStderr), processStderr)
err = process.Run()
go func() {
io.Copy(io.MultiWriter(processStdin, &collectedStdin), input)
err = process.Start()
if err != nil {
var waitgroup sync.WaitGroup
go func() {
io.Copy(io.MultiWriter(stderr, &collectedStderr), processStderr)
io.Copy(io.MultiWriter(output, &collectedStdout), processStdout)
err = process.Wait()
processErrorString := ""
if err != nil {
processErrorString = err.Error()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment