Package-Level Functions (total 12, in which 7 are exported)
GoVersion reports the minor version number of the highest release
tag built into the go command on the PATH.
Note that this may be higher than the version of the go tool used
to build this application, and thus the versions of the standard
go/{scanner,parser,ast,types} packages that are linked into it.
In that case, callers should either downgrade to the version of
go used to build the application, or report an error that the
application is too old to use the go command on the PATH.
GoVersionOutput returns the complete output of the go version command.
ParseGoVersionOutput extracts the Go version string
from the output of the "go version" command.
Given an unrecognized form, it returns an empty string.
VendorEnabled reports whether vendoring is enabled. It takes a *Runner to execute Go commands
with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields,
of which only Verb and Args are modified to run the appropriate Go command.
Inspired by setDefaultBuildMod in modload/init.go
WorkspaceVendorEnabled reports whether workspace vendoring is enabled. It takes a *Runner to execute Go commands
with the supplied context.Context and Invocation. The Invocation can contain pre-defined fields,
of which only Verb and Args are modified to run the appropriate Go command.
Inspired by setDefaultBuildMod in modload/init.go
WriteOverlays writes each value in the overlay (see the Overlay
field of go/packages.Config) to a temporary file and returns the name
of a JSON file describing the mapping that is suitable for the "go
list -overlay" flag.
On success, the caller must call the cleanup function exactly once
when the files are no longer needed.
getMainModuleAnd114 gets one of the main modules' information and whether the
go command in use is 1.14+. This is the information needed to figure out
if vendoring should be enabled.
getWorkspaceMainModules gets the main modules' information.
This is the information needed to figure out if vendoring should be enabled.
runCmdContext is like exec.CommandContext except it sends os.Interrupt
before os.Kill.
Package-Level Variables (total 5, in which 1 is exported)
DebugHangingGoCommands may be set by tests to enable additional
instrumentation (including panics) for debugging hanging Go commands.
See golang/go#54461 for details.
event keys for go command invocations
1.13: go: updates to go.mod needed, but contents have changed
1.14: go: updating go.mod: existing contents have changed since last read