package testlog Import Path internal/testlog (on golang.org and go.dev) Dependency Relation imports 2 packages, and imported by 2 packagesInvolved Source Files exit.go Package testlog provides a back-channel communication path between tests and package os, so that cmd/go can see which environment variables and files a test consults.Package-Level Type Names (only one)Interface is the interface required of test loggers. The os package will invoke the interface's methods to indicate that it is inspecting the given environment variables or files. Multiple goroutines may call these methods simultaneously. ( T) Chdir(dir string) ( T) Getenv(key string) ( T) Open(file string) ( T) Stat(file string) func Logger() Interface func SetLogger(impl Interface)Package-Level Functions (total 7)Getenv calls Logger().Getenv, if a logger has been set.Logger returns the current test logger implementation. It returns nil if there is no logger.Open calls Logger().Open, if a logger has been set.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.SetLogger sets the test logger implementation for the current process. It must be called only once, at process startup.SetPanicOnExit0 sets panicOnExit0 to v.Stat calls Logger().Stat, if a logger has been set.
|The pages are generated with Golds v0.3.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.|