base

package standard library
go1.11beta2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2018 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package base defines shared basic pieces of the go command, in particular logging and the Command structure.

Index

Constants

View Source
const ToolWindowsExtension = ".exe"

Variables

View Source
var (
	ToolGOOS      = runtime.GOOS
	ToolGOARCH    = runtime.GOARCH
	ToolIsWindows = ToolGOOS == "windows"
	ToolDir       = build.ToolDir
)

Configuration for finding tool binaries.

View Source
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'.

View Source
var Cwd = getwd()
View Source
var Interrupted = make(chan struct{})

Interrupted is closed when the go command receives an interrupt signal.

View Source
var SignalTrace os.Signal = syscall.SIGQUIT

SignalTrace is the signal to send to make a Go program crash with a stack trace.

View Source
var Usage func()

Usage is the usage-reporting function, filled in by package main but here for reference by other packages.

Functions

func AddBuildFlagsNX

func AddBuildFlagsNX(flags *flag.FlagSet)

AddBuildFlagsNX adds the -n and -x build flags to the flag set.

func AtExit

func AtExit(f func())

func EnvForDir

func EnvForDir(dir string, base []string) []string

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.

func Errorf

func Errorf(format string, args ...interface{})

func