I am using Go 1.14 AMD64 on Linux 5.3.0.
When I create a subprocess with exec.Cmd.Start, I can't seem to fully kill it with exec.Cmd.Process.Kill, or at least not to the satisfaction of exec.Cmd.Wait.
I am doing something along the lines of:
cmd := exec.Command(binPath)
if err := cmd.Start(); err != nil {
...
}
if err := cmd.Process.Kill(); err != nil {
...
}
if err := cmd.Wait(); err != nil {
...
}
However, this hangs on Wait. As far as I can tell this shouldn't happen. Any idea what I might be doing wrong?