go/src/internal/testlog/exit.go

// PanicOnExit0 reports whether to panic on a call to os.Exit(0).
// This is in the testlog package because, like other definitions in
// package testlog, it is a hook between the testing package and the
// os package. This is used to ensure that an early call to os.Exit(0)
// does not cause a test to pass.
func PanicOnExit0() bool {}

var panicOnExit0

// SetPanicOnExit0 sets panicOnExit0 to v.
//
// SetPanicOnExit0 should be an internal detail,
// but alternate implementations of go test in other
// build systems may need to access it using linkname.
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
//
//go:linkname SetPanicOnExit0
func SetPanicOnExit0(v bool) {}