buildcfg

package standard library
go1.17beta1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package buildcfg provides access to the build configuration described by the current environment. It is for use by build tools such as cmd/go or cmd/compile and for setting up go/build's Default context.

Note that it does NOT provide access to the build configuration used to build the currently-running binary. For that, use runtime.GOOS etc as well as internal/goexperiment.

Index

Constants

This section is empty.

Variables

View Source
var (
	GOROOT   = envOr("GOROOT", defaultGOROOT)
	GOARCH   = envOr("GOARCH", defaultGOARCH)
	GOOS     = envOr("GOOS", defaultGOOS)
	GO386    = envOr("GO386", defaultGO386)
	GOARM    = goarm()
	GOMIPS   = gomips()
	GOMIPS64 = gomips64()
	GOPPC64  = goppc64()
	GOWASM   = gowasm()
	GO_LDSO  = defaultGO_LDSO
	Version  = version
)
View Source
var Error error

Error is one of the errors found (if any) in the build configuration.

View Source
var Experiment goexperiment.Flags = parseExperiments()

Experiment contains the toolchain experiments enabled for the current build.

(This is not necessarily the set of experiments the compiler itself was built with.)

View Source
var FramePointerEnabled = GOARCH == "amd64" || GOARCH == "arm64"

FramePointerEnabled enables the use of platform conventions for saving frame pointers.

This used to be an experiment, but now it's always enabled on platforms that support it.

Note: must agree with runtime.framepointer_enabled.

Functions

func AllExperiments

func AllExperiments() []string

AllExperiments returns a list of all experiment settings. Disabled experiments appear in the list prefixed by "no".

func Check

func Check()

Check exits the program with a fatal error if Error is non-nil.

func EnabledExperiments

func EnabledExperiments() []string

EnabledExperiments returns a list of enabled experiments, as lower-cased experiment names.

func GOEXPERIMENT

func GOEXPERIMENT() string

GOEXPERIMENT is a comma-separated list of enabled or disabled experiments that differ from the baseline experiment configuration. GOEXPERIMENT is exactly what a user would set on the command line to get the set of enabled experiments.

func Getgoextlinkenabled

func Getgoextlinkenabled() string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL