aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2016-06-08 21:09:09 -0700
committerIan Lance Taylor <iant@golang.org>2016-06-09 13:47:13 +0000
commita8c6c4837c17ab4ec3ba78e40b9a72dc70d9cf5a (patch)
tree5a8cb545547c8a28be71773be77b45433f8c5ee6
parent763883632e4d7fea145b6f3a7ee501b5ad9096f2 (diff)
downloadgo-a8c6c4837c17ab4ec3ba78e40b9a72dc70d9cf5a.tar.gz
go-a8c6c4837c17ab4ec3ba78e40b9a72dc70d9cf5a.zip
os: document that the runtime can write to standard error
Fixes #15970. Change-Id: I3f7d8316069a69d0e3859aaa96bc1414487fead0 Reviewed-on: https://go-review.googlesource.com/23921 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
-rw-r--r--src/os/file.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/os/file.go b/src/os/file.go
index 74d3c9f963..e546441497 100644
--- a/src/os/file.go
+++ b/src/os/file.go
@@ -46,6 +46,10 @@ func (f *File) Name() string { return f.name }
// Stdin, Stdout, and Stderr are open Files pointing to the standard input,
// standard output, and standard error file descriptors.
+//
+// Note that the Go runtime writes to standard error for panics and crashes;
+// closing Stderr may cause those messages to go elsewhere, perhaps
+// to a file opened later.
var (
Stdin = NewFile(uintptr(syscall.Stdin), "/dev/stdin")
Stdout = NewFile(uintptr(syscall.Stdout), "/dev/stdout")