protoplugin
protoplugin copied to clipboard
Prevent streams from being nil
Putting this up for discussion.
Should we protect users from accidentally forgetting to set one of stdin, stdout or stderr to nil to avoid a panic?
The alternative, instead of failing with an error, is to set these to a sane default like os.Stdin, os.Stdout, os.Stderr.
Either option, sane default or explicit error, seems better than a panic?
EDIT: one more alternative -- have a WithEnv option, where run uses os.Stdin, os.Stdout, os.Stderr by default, but the caller can modify this behavior with a supplied option.
Yea we should do one or the other - I'm hesitant to default, but let's think about it.