Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent streams from being nil #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Prevent streams from being nil #12

wants to merge 1 commit into from

Conversation

mfridman
Copy link
Member

@mfridman mfridman commented Mar 18, 2024

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.

@bufdev
Copy link
Member

bufdev commented Mar 23, 2024

Yea we should do one or the other - I'm hesitant to default, but let's think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants