]> Cypherpunks repositories - gostls13.git/commit
runtime/debug: clarify SetCrashOutput dup behavior
authorMichael Pratt <mpratt@google.com>
Wed, 31 Jan 2024 19:01:12 +0000 (14:01 -0500)
committerMichael Pratt <mpratt@google.com>
Wed, 21 Feb 2024 20:35:26 +0000 (20:35 +0000)
commitb27d02c07b7bdb896f279a386fde8cb5ce284ec9
tree6938511a3b7e6935ef16f964c22894430be7c14b
parent806aeb1e7667958047ef744cac16319e662d1b1e
runtime/debug: clarify SetCrashOutput dup behavior

SetCrashOutput dup's the input file for safety, but I don't think that
the docs are very clear about what the caller can/should do with f. "it
does not close the previous file" is particularly confusing, as it does
close the previous FD (but not the previous passed os.File).

Expand and attempt to clarify the explanation, borrowing wording from
net.FileConn, which also dup's the input os.File.

For #42888.

Change-Id: I1c96d2dce7899e335d8f1cd464d2d9b31aeb4e5e
Reviewed-on: https://go-review.googlesource.com/c/go/+/559800
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/debug/stack.go