-
-
Notifications
You must be signed in to change notification settings - Fork 294
Closed
Description
I'm trying to pass session.Wait().Out
to bufio.NewScanner
to parse the stdout and use the result in subsequent commands, but I guess that Wait()
closes the buffer (i.e., Out
), hence the issue.
Currently I'm using Out.Contents()
instead, but that requires some workaround, so I decide to ask here at the same time.
I'm aware that this behavior is documented, but I fail to figure out the rationale behind.
The documentation of gbytes.Buffer.Close
only mentions:
Close signifies that the buffer will no longer be written to
, and it seems that reading from a closed buffer is legit, just like reading from a closed channel.
Please let me know if I'm missing anything, thanks a lot!
Metadata
Metadata
Assignees
Labels
No labels