> I am not proposing getting rid of Stdin, Stdout, or Stderr, just exposing
> the Session as a ReaderWriterCloser (it already has Closer) for the common
> case (Stdin and Stdout).
I'm hesitant to do that because what might be the common case for you,
may be uncommon for others. I believe that scp uses the stderr channel
for signalling, and probably other examples that I'm not aware of. If
you want to propose a CL to implement that then lets see what people
think.
> -Brian
>
> ps: I would make the same proposal for exec.Cmd, actually.
I can't speak for the Authors, but I would imagine this having a low
chance of being merged. Go 1.1 feature window is closed, and this is
*almost* a change to the Go 1 API contract.
A counter proposal would be a new method in io/ioutil, func
ReadWriteCloser(io.Reader, io.Writer, io.Closer) io.ReadWriteCloser,
but it's almost as many lines as just writing
s, _ := conn.NewSession()
rwc := struct{ io.ReadCloser, io.Writer } { s, s } // implements
io.ReadWriteCloser