commit | 0997ad001e19acf1be613b3f75a47f94ab554efa | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Tue Dec 29 11:23:20 2015 -0800 |
committer | Todd Wang <toddw@google.com> | Tue Dec 29 11:23:20 2015 -0800 |
tree | 192fc75e38b40e3e74e781145bb56a145f2a6223 | |
parent | 57dd739835226800380d02641a23d1d203e704ac [diff] |
ref: Change gosh.Cmd.AddStdoutWriter to take an io.WriteCloser The rationale behind this change is detailed here: https://github.com/vanadium/issues/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: 2/2 Change-Id: Iefd67aef7f9d5beab1786adadcc423fdbf2d8fd2
This repository contains a reference implementation of the Vanadium APIs.
Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.