Kill the process and subprocesses.
(cmd *exec.Cmd)
| 38 | |
| 39 | // Kill the process and subprocesses. |
| 40 | func Kill(cmd *exec.Cmd) error { |
| 41 | if cmd.Process == nil { |
| 42 | return fmt.Errorf("%v does not have a process handle", cmd) |
| 43 | } |
| 44 | return syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL) |
| 45 | } |