I'm writing a command line wrapper that sets some state in the world, starts a child process, waits for it to complete, and then unsets some state in the world.
So basically something like
doSomeStatefulThing()
cmd := exec.Command("subcmd", args...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
undoSomeStatefulThing()
return err
I missed the line in the signal.Notify docs that says
If no signals are provided, all incoming signals will be relayed to c. Otherwise, just the provided signals will.
It might be good to provide a second Example for Notify where the args... list is empty, for people who are silly like me and miss the doc.
(It might also be good if it was easier to set up a proxied command - it seems like it's easy to miss some of the steps involved in proxying through all FD's/signals in both directions.)
I'm writing a command line wrapper that sets some state in the world, starts a child process, waits for it to complete, and then unsets some state in the world.
So basically something like
I missed the line in the
signal.Notifydocs that saysIt might be good to provide a second Example for Notify where the args... list is empty, for people who are silly like me and miss the doc.
(It might also be good if it was easier to set up a proxied command - it seems like it's easy to miss some of the steps involved in proxying through all FD's/signals in both directions.)