goexpect icon indicating copy to clipboard operation
goexpect copied to clipboard

Why goexpect use TeeWriter to handle both stdout and stderr

Open fangxlmr opened this issue 4 years ago • 3 comments

Hi, the crew, great job of this package!

https://github.com/google/goexpect/blob/b5b77125c2c58628339d1f0a3d12d6dfd1b2a5e2/expect.go#L1161

As said, goexpect wirte stdout and stderr both to an io.Writer (if any). Isn't it resonable to handle them separately? BTW, tee command itself merely captures stdout. ;P

fangxlmr avatar Jan 27 '21 07:01 fangxlmr

Hey thx. for the feedback @fangxlmr.

Sounds reasonable to me, currently my cycles are very limited so could be a while before I'll have a chance to dig into this.

PRs are always prioritized though.. :)

skalle avatar Jan 27 '21 08:01 skalle

Well, a single teeWriter-like option for handling both stdin and stdout does has its advantange, whereas an option to handle them separately may also have its own position.

fangxlmr avatar Jan 28 '21 01:01 fangxlmr

Yeah GoExpect do have the concept of options, should probably be implemented as a new option with the default being the current way it's handled.

skalle avatar Jan 28 '21 03:01 skalle