]> Cypherpunks repositories - gostls13.git/commitdiff
os: document that the runtime can write to standard error
authorIan Lance Taylor <iant@golang.org>
Thu, 9 Jun 2016 04:09:09 +0000 (21:09 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 9 Jun 2016 13:47:13 +0000 (13:47 +0000)
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>
src/os/file.go

index 74d3c9f9631de242c223966479eac0faddf00f2a..e546441497b5e72d1936262e6eb0b62f802a0c7b 100644 (file)
@@ -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")