mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime/debug: eliminate temporary variadicity from SetCrashOutput
Updates #67182 Change-Id: I33fc8c515f4a9d120262ba30f61aea80ede5e9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/585420 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
6cd066f8b2
commit
a22cb5cabe
5 changed files with 6 additions and 12 deletions
|
|
@ -46,14 +46,7 @@ type CrashOptions struct {
|
|||
// To disable this additional crash output, call SetCrashOutput(nil).
|
||||
// If called concurrently with a crash, some in-progress output may be written
|
||||
// to the old file even after an overriding SetCrashOutput returns.
|
||||
//
|
||||
// TODO(adonovan): the variadic ... is a short-term measure to avoid
|
||||
// breaking the call in x/telemetry; it will be removed before the
|
||||
// go1.23 freeze.
|
||||
func SetCrashOutput(f *os.File, opts ...CrashOptions) error {
|
||||
if len(opts) > 1 {
|
||||
panic("supply at most 1 CrashOptions")
|
||||
}
|
||||
func SetCrashOutput(f *os.File, opts CrashOptions) error {
|
||||
fd := ^uintptr(0)
|
||||
if f != nil {
|
||||
// The runtime will write to this file descriptor from
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue