Documentation
¶
Overview ¶
Package goenv returns environment variables that are used in various parts of the compiler. You can query it manually with the `tinygo env` subcommand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // This variable is set at build time using -ldflags parameters. // See: https://stackoverflow.com/a/11355611 GitSha1 string )
var Keys = []string{
"GOOS",
"GOARCH",
"GOROOT",
"GOPATH",
"GOCACHE",
"CGO_ENABLED",
"TINYGOROOT",
}
Keys is a slice of all available environment variable keys.
var TINYGOROOT string
TINYGOROOT is the path to the final location for checking tinygo files. If unset (by a -X ldflag), then sourceDir() will fallback to the original build directory.
Functions ¶
func ClangResourceDir ¶ added in v0.31.0
ClangResourceDir returns the clang resource dir if available. This is the -resource-dir flag. If it isn't available, an empty string is returned and -resource-dir should be left unset. The libclang flag must be set if the resource dir is read for use by libclang. In that case, the resource dir is always returned (even when linking dynamically against LLVM) because libclang always needs this directory.
func Get ¶
Get returns a single environment variable, possibly calculating it on-demand. The empty string is returned for unknown environment variables.
func GetGorootVersion ¶ added in v0.14.0
GetGorootVersion returns the major and minor version for a given GOROOT path. If the goroot cannot be determined, (0, 0) is returned.
func GorootVersionString ¶ added in v0.14.0
GorootVersionString returns the version string as reported by the Go toolchain. It is usually of the form `go1.x.y` but can have some variations (for beta releases, for example).
Types ¶
This section is empty.