@@ -92,8 +92,17 @@ type Cmd struct {
92
92
// If either is nil, Run connects the corresponding file descriptor
93
93
// to the null device (os.DevNull).
94
94
//
95
- // If Stdout and Stderr are the same writer, and have a type that can be compared with ==,
96
- // at most one goroutine at a time will call Write.
95
+ // If either is an *os.File, the process's standard output or standard
96
+ // error, respectively, are connected directly to that file. Otherwise,
97
+ // if either is not nil, during the execution of the command a separate
98
+ // goroutine reads from the process's standard output or standard error
99
+ // and delivers that to Stdout or Stderr. In this case, Wait does not
100
+ // complete until the goroutine stops copying, either because it has
101
+ // reached the end of Stdin (EOF or a read error) or because writing to
102
+ // the pipe returned an error.
103
+ //
104
+ // If Stdout and Stderr are the same writer, and have a type that can
105
+ // be compared with ==, at most one goroutine at a time will call Write.
97
106
Stdout io.Writer
98
107
Stderr io.Writer
99
108
@@ -190,7 +199,7 @@ func (c *Cmd) argv() []string {
190
199
}
191
200
192
201
// skipStdinCopyError optionally specifies a function which reports
193
- // whether the provided the stdin copy error should be ignored.
202
+ // whether the provided stdin copy error should be ignored.
194
203
// It is non-nil everywhere but Plan 9, which lacks EPIPE. See exec_posix.go.
195
204
var skipStdinCopyError func (error ) bool
196
205
@@ -429,9 +438,8 @@ func (e *ExitError) Error() string {
429
438
// error is of type *ExitError. Other error types may be
430
439
// returned for I/O problems.
431
440
//
432
- // If c.Stdin is not an *os.File, Wait also waits for the I/O loop
433
- // copying from c.Stdin into the process's standard input
434
- // to complete.
441
+ // If any of c.Stdin, c.Stdout or c.Stderr are not an *os.File, Wait also waits
442
+ // for the respective I/O loop copying to or from the process to complete.
435
443
//
436
444
// Wait releases any resources associated with the Cmd.
437
445
func (c * Cmd ) Wait () error {
0 commit comments