mirror of
https://github.com/golang/go
synced 2024-11-23 09:40:04 -07:00
os/exec: document that non-comparable writers may race
The comment for Cmd.Stdout and Cmd.Stderr says that it's safe to set both to the same writer, but it doesn't say that this only works when both writers are comparable. This change updates the comment to explain that using a non-comparable writer may still lead to a race. Fixes #19804 Change-Id: I63b420034666209a2b6fab48b9047c9d07b825e2 Reviewed-on: https://go-review.googlesource.com/42052 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f105c91757
commit
585be4639b
@ -83,8 +83,8 @@ type Cmd struct {
|
||||
// If either is nil, Run connects the corresponding file descriptor
|
||||
// to the null device (os.DevNull).
|
||||
//
|
||||
// If Stdout and Stderr are the same writer, at most one
|
||||
// goroutine at a time will call Write.
|
||||
// If Stdout and Stderr are the same writer, and have a type that can be compared with ==,
|
||||
// at most one goroutine at a time will call Write.
|
||||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user