Hello, I have a weird issue where I spawn a process and the cmd.Wait() method never returns even though the spawned Linux process is dead, I saw this from the doc:
If any of c.Stdin, c.Stdout or c.Stderr are not an *os.File, Wait also waits for the respective I/O loop copying to or from the process to complete.
Wait waits for the command to exit and waits for any copying to stdin or copying from stdout or stderr to complete.
In my code I have this:
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stdout
How can I make sure that those goroutines that do the I/O copy always returns when the process dies even if the copy is no completed? To add a bit more context I think that the subprocess forks() itself when it crashes… so it might create an issue with the stderr / stdout.