Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/multiproc/apipe/apipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ func demo2() {
fmt.Printf("Error: Can not obtain the stdin pipe for command: %s\n", err)
return
}
outputBuf1.WriteTo(stdin2)

var outputBuf2 bytes.Buffer
cmd2.Stdout = &outputBuf2
if err := cmd2.Start(); err != nil {
fmt.Printf("Error: The command can not be startup: %s\n", err)
return
}
outputBuf1.WriteTo(stdin2)
err = stdin2.Close()
if err != nil {
fmt.Printf("Error: Can not close the stdio pipe: %s\n", err)
Expand Down