Remove unnecessary select statement (#692)

* Remove unnecessary select statement

* Remove unnecessary if-statement
This commit is contained in:
Pontus Leitzler 2017-10-18 07:38:48 +02:00 committed by Ben Kochie
parent 1824ac3b9e
commit 0b6763886a

View File

@ -129,14 +129,9 @@ func runCommandAndTests(cmd *exec.Cmd, address string, fn func(pid int) error) e
errc <- fn(pid)
}(cmd.Process.Pid)
select {
case err := <-errc:
if cmd.Process != nil {
cmd.Process.Kill()
}
if err != nil {
return err
}
err := <-errc
if cmd.Process != nil {
cmd.Process.Kill()
}
return nil
return err
}