-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: Change gosh.Cmd.AddStdoutWriter to take an io.WriteCloser
The rationale behind this change is detailed here: vanadium/issues#1031 The basic idea is that the previous gosh behavior wrt Cmd.AddStdoutWriter (and AddStderrWriter) was a bit weird. We took an io.Writer argument w, and if w happened to implement io.Closer, we'd auto-close w when the process finished. The semantics of Close is largely implementation-dependent, which made the gosh usage a bit scary. In addition we special-cased os.Stdout and os.Stderr, to prevent closing those when a single cmd finished. This change makes things more explicit. We always take an io.WriteCloser as an argument, which we will auto-close when the process finishes. We also remove the os.Stdout and os.Stderr special-cases, and add gosh.NopWriteCloser instead. MultiPart: 1/2 Change-Id: I77d04a1bc90f1b07fe4d0f8815a963f4fb73739e
- Loading branch information
Todd Wang
committed
Jan 5, 2016
1 parent
4cd09de
commit e446fbd
Showing
7 changed files
with
209 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.