testlog
packagestandard libraryThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package testlog provides a back-channel communication pathbetween tests and package os, so that cmd/go can see whichenvironment variables and files a test consults.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcPanicOnExit0¶added ingo1.16
func PanicOnExit0()bool
PanicOnExit0 reports whether to panic on a call to os.Exit(0).This is in the testlog package because, like other definitions inpackage testlog, it is a hook between the testing package and theos package. This is used to ensure that an early call to os.Exit(0)does not cause a test to pass.
funcSetLogger¶
func SetLogger(implInterface)
SetLogger sets the test logger implementation for the current process.It must be called only once, at process startup.
funcSetPanicOnExit0¶added ingo1.16
func SetPanicOnExit0(vbool)
SetPanicOnExit0 sets panicOnExit0 to v.
SetPanicOnExit0 should be an internal detail,but alternate implementations of go test in otherbuild systems may need to access it using linkname.
Do not remove or change the type signature.See go.dev/issue/67401.