Documentation
¶
Overview ¶
Package base defines shared basic pieces of the go command, in particular logging and the Command structure.
Index ¶
- Constants
- Variables
- func AddBuildFlagsNX(flags *flag.FlagSet)
- func AtExit(f func())
- func EnvForDir(dir string, base []string) []string
- func Errorf(format string, args ...interface{})
- func Exit()
- func ExitIfErrors()
- func ExpandScanner(err error) error
- func Fatalf(format string, args ...interface{})
- func IsTestFile(file string) bool
- func MergeEnvLists(in, out []string) []string
- func RelPaths(paths []string) []string
- func Run(cmdargs ...interface{})
- func RunStdin(cmdline []string)
- func SetExitStatus(n int)
- func ShortPath(path string) string
- func StartSigHandlers()
- func Tool(toolName string) string
- type Command
- type StringsFlag
Constants ¶
const ToolWindowsExtension = ".exe"
Variables ¶
var ( ToolGOOS = runtime.GOOS ToolGOARCH = runtime.GOARCH ToolIsWindows = ToolGOOS == "windows" ToolDir = build.ToolDir )
Configuration for finding tool binaries.
var Commands []*Command
Commands lists the available commands and help topics. The order here is the order in which they are printed by 'go help'.
var Cwd = getwd()
var Interrupted = make(chan struct{})
Interrupted is closed when the go command receives an interrupt signal.
var SignalTrace os.Signal = syscall.SIGQUIT
SignalTrace is the signal to send to make a Go program crash with a stack trace.
var Usage func()
Usage is the usage-reporting function, filled in by package main but here for reference by other packages.
Functions ¶
func AddBuildFlagsNX ¶
AddBuildFlagsNX adds the -n and -x build flags to the flag set.
func EnvForDir ¶
EnvForDir returns a copy of the environment suitable for running in the given directory. The environment is the current process's environment but with an updated $PWD, so that an os.Getwd in the child will be faster.