The following works just fine when cmd finishes in the allotted time. However, the timeout is not working. While it does print \"It\'s dead Jim\", not only do
\"It\'s dead Jim\"
Just for reference, I'll put my Windows solution here as well:
func kill(cmd *exec.Cmd) error { kill := exec.Command("TASKKILL", "/T", "/F", "/PID", strconv.Itoa(cmd.Process.Pid)) kill.Stderr = os.Stderr kill.Stdout = os.Stdout return kill.Run() }