Browse Source

Remove unnecessary select statement (#692)

* Remove unnecessary select statement

* Remove unnecessary if-statement
pull/707/head
Pontus Leitzler 7 years ago committed by Ben Kochie
parent
commit
0b6763886a
  1. 13
      node_exporter_test.go

13
node_exporter_test.go

@ -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
}

Loading…
Cancel
Save