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
7 files changed
tree: 9801aeedf1ea515ae4757b8a4e580d51ea21547d
  1. cmd/
  2. cmdline/
  3. dbutil/
  4. envvar/
  5. gosh/
  6. host/
  7. ibe/
  8. metadata/
  9. netconfig/
  10. netstate/
  11. set/
  12. textutil/
  13. timing/
  14. toposort/
  15. vlog/
  16. .gitignore
  17. .godepcop
  18. AUTHORS
  19. CONTRIBUTING.md
  20. CONTRIBUTORS
  21. LICENSE
  22. PATENTS
  23. README.md
  24. VERSION
README.md

This repository contains general purpose libraries used by the Vanadium project. TEST