-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeSuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.
Milestone
Description
Cmd.StdoutPipe, Cmd.StdinPipe, Cmd.StderrPipe all close the client end of the pipe when
Wait returns. This is problematic when there's an independent goroutine that uses the
client end of the pipe. For example, this code can
fail to copy all the data from a command.
c := exec.Command("some-command")
r, err := c.StdoutPipe()
if err != nil {...}
go io.Copy(dest, r)
c.Run()
Since all these methods return io.*Closer types, it seems reasonable to me that the
caller should have the responsibility for closing them.Metadata
Metadata
Assignees
Labels
FrozenDueToAgeSuggestedIssues that may be good for new contributors looking for work to do.Issues that may be good for new contributors looking for work to do.