On Fri, Sep 29, 2017 at 1:33 PM, Alex Buchanan <bucha...@ohsu.edu> wrote: > > Ok, that's a great explanation, thanks. Do you have a recommendation for how > to exit early? Would StdoutPipe() help? I tried setting Setpgid to true, but > probably os/exec doesn't pay attention to process groups. > > Alternatively, I can configure my shell scripts to close stdout/err on exit? > Not pretty, but might work. > > My best approach so far is to use time.After and panic, instead of context. > This code is being used in a test, so panic is somewhat acceptable.
I would say that CommandContext is really only useful for simple programs, not for shell scripts. So using time.After seems reasonable to me. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.