aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
authorJustin Nuß <nuss.justin@gmail.com>2017-04-28 12:04:45 +0200
committerIan Lance Taylor <iant@golang.org>2017-04-28 17:57:01 +0000
commit585be4639b927430189fa8197985816aec3e88cd (patch)
treedbfd9b0b8ae9f43fb653ceca6109778d98a92297 /src/os/exec/exec.go
parentf105c917573dea3e94edf7c7a4e64e1c934a0db2 (diff)
downloadgo-585be4639b927430189fa8197985816aec3e88cd.tar.gz
go-585be4639b927430189fa8197985816aec3e88cd.zip
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>
Diffstat (limited to 'src/os/exec/exec.go')
-rw-r--r--src/os/exec/exec.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go
index 6b5d70990a..0b16f22a99 100644
--- a/src/os/exec/exec.go
+++ b/src/os/exec/exec.go
@@ -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