Commit 585be463 authored by Justin Nuß's avatar Justin Nuß Committed by Ian Lance Taylor

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/42052Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent f105c917
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment