commit | 16f80536a47d65ad1b6e773759e795b3d29e0e59 | [log] [tgz] |
---|---|---|
author | Todd Wang <toddw@google.com> | Fri Jan 29 16:04:46 2016 -0800 |
committer | Todd Wang <toddw@google.com> | Fri Jan 29 16:04:46 2016 -0800 |
tree | a902ff17a0bcc1a258f2cdfa340385ca7e9dd24a | |
parent | 14cc6ccf273d29d7d99af13c92e6039bc7b4726f [diff] |
lib: Add gosh.Pipeline, simplify AddStd{out,err}Writer. This CL introduces a new Pipeline concept to gosh. The idea is similar to bash command pipelines; you can connect a sequence of commands together, with stdout and/or stderr of one command connected to the stdin of the next command. The Pipeline API is similar to the Cmd API, with unnecessary methods removed, and with Pipe{Stdout,Stderr,CombinedOutput} methods to construct the pipeline. Also simplified Cmd.AddStd{out,err}Writer semantics, by changing the argument from io.WriteCloser to io.Writer. We no longer automatically close these writers on exit. This means we can now write AddStdoutWriter(os.Stdout) without needing gosh.NopWriteCloser, which has been removed. If you need to close your writer, you are responsible for calling close at the appropriate point in the code yourself. MultiPart: 3/4 Change-Id: I3885b5eae997100dbf6f876818e1c9a1297f17b7
This repository contains general purpose libraries used by the Vanadium project. TEST