mirror of
https://github.com/prometheus/node_exporter
synced 2024-12-24 15:12:15 +00:00
Remove unnecessary select statement (#692)
* Remove unnecessary select statement * Remove unnecessary if-statement
This commit is contained in:
parent
1824ac3b9e
commit
0b6763886a
@ -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…
Reference in New Issue
Block a user