// PrintStack prints to standard error the stack trace returned by runtime.Stack. func PrintStack() { … } // Stack returns a formatted stack trace of the goroutine that calls it. // It calls [runtime.Stack] with a large enough buffer to capture the entire trace. func Stack() []byte { … } type CrashOptions … // SetCrashOutput configures a single additional file where unhandled // panics and other fatal errors are printed, in addition to standard error. // There is only one additional file: calling SetCrashOutput again overrides // any earlier call. // SetCrashOutput duplicates f's file descriptor, so the caller may safely // close f as soon as SetCrashOutput returns. // 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. func SetCrashOutput(f *os.File, opts CrashOptions) error { … } //go:linkname runtime_setCrashFD runtime.setCrashFD func runtime_setCrashFD(uintptr) uintptr