first working version

This commit is contained in:
ston1th 2019-04-28 18:16:40 +02:00
commit de359ab415
47 changed files with 1016 additions and 2012 deletions

View file

@ -1,6 +1,7 @@
package core
import (
"errors"
"os/exec"
"time"
)
@ -24,7 +25,12 @@ func Timeout(cmd *exec.Cmd, t time.Duration) (output []byte, err error) {
}
err = <-done
case e := <-done:
err = e
exerr, ok := e.(*exec.ExitError)
if ok {
err = errors.New(e.Error() + "\n" + string(exerr.Stderr))
} else {
err = e
}
output = <-out
}
return