You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hmm .. ok I understand the bug. https://pkg.go.dev/os/exec#Cmd.StdoutPipe
Cmd.Wait will close the pipe after seeing the command exit, so most callers need not close the pipe themselves. It is thus incorrect to call Wait before all reads from the pipe have completed.
So using a scanner to read from the pipe is error-prone and probably why it fails a lot of times. The better way is to directly set the StdErr/Stdout fields with a custom io.Writer.
So using a scanner to read from the pipe is error-prone and probably why it fails a lot of times. The better way is to directly set the StdErr/Stdout fields with a custom io.Writer.
and then
Having the same writer for stdout and stderr is handled properly in the stdlib:
@fmartingr - can we try with something like this?
Originally posted by @agnivade in #833 (comment)
The text was updated successfully, but these errors were encountered: