package
0.0.0-20240310010237-a3f02065c60a
Repository: https://github.com/goki/go-tools.git
Documentation: pkg.go.dev
# Functions
Command is like exec.Command, but applies the same changes as testenv.CommandContext (with a default Context).
CommandContext is like exec.CommandContext, but: - skips t if the platform does not support os/exec, - if supported, sends SIGQUIT instead of SIGKILL in its Cancel function - if the test has a deadline, adds a Context timeout and (if supported) WaitDelay for an arbitrary grace period before the test's deadline expires, - if Cmd has the Cancel field, fails the test if the command is canceled due to the test's deadline, and - if supported, sets a Cleanup function that verifies that the test did not leak a subprocess.
Deadline returns the deadline of t, if known, using the Deadline method added in Go 1.15.
ExitIfSmallMachine emits a helpful diagnostic and calls os.Exit(0) if the current machine is a builder known to have scarce resources.
Go1Point returns the x in Go 1.x.
GOROOT reports the path to the directory containing the root of the Go project source tree.
HasExec reports whether the current system can start new processes using os.StartProcess or (more commonly) exec.Command.
NeedsExec checks that the current system can start new processes using os.StartProcess or (more commonly) exec.Command.
NeedsGo1Point skips t if the Go version used to run the test is older than 1.x.
NeedsGoBuild skips t if the current system can't build programs with “go build” and then run them with os.StartProcess or exec.Command.
NeedsGoPackages skips t if the go/packages driver (or 'go' tool) implied by the current process environment is not present in the path.
NeedsGoPackagesEnv skips t if the go/packages driver (or 'go' tool) implied by env is not present in the path.
NeedsLocalhostNet skips t if networking does not work for ports opened with "localhost".
NeedsLocalXTools skips t if the github.com/goki/go-tools module is replaced and its replacement directory does not exist (or does not contain the module).
NeedsTool skips t if the named tool is not present in the path.
SkipAfterGo1Point skips t if the Go version used to run the test is newer than 1.x.
WriteImportcfg writes an importcfg file used by the compiler or linker to dstPath containing entries for the packages in std and cmd in addition to the package to package file mappings in additionalPackageFiles.
# Variables
Sigquit is the signal to send to kill a hanging subprocess.