commit | e446fbd5c32c16e0a7bc8bd600b4582e20bb7a4f | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Mon Jan 04 17:27:21 2016 -0800 |
committer | Todd Wang <toddw@google.com> | Mon Jan 04 17:27:34 2016 -0800 |
tree | 9801aeedf1ea515ae4757b8a4e580d51ea21547d | |
parent | 4cd09def81b465086add5eedc3185dd5e7376d4c [diff] |
lib: 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: 1/2 Change-Id: I77d04a1bc90f1b07fe4d0f8815a963f4fb73739e
This repository contains general purpose libraries used by the Vanadium project. TEST