google / goexpect

Expect for Go
BSD 3-Clause "New" or "Revised" License
759 stars 134 forks source link

Receive bufferSize should be configurable #64

Closed ryandgoulding closed 3 years ago

ryandgoulding commented 3 years ago

goexpect fails when the client expects payloads larger than the default buffer size.

A dynamically growing byte slice will not work in this instance, due to the fact that the PTY File is not closed after receiving command output (i.e., does not receive io.EOF). As such, something like ioutil.ReadAll(...) cannot be used in this context, and will eventually just timeout waiting for io.EOF or an error.

Support should be added to at least make bufferSize configurable, preferably per GExpect instance.

ryandgoulding commented 3 years ago

Resolved by #65