package gocommand

Import Path
	golang.org/x/tools/internal/gocommand (on go.dev)

Dependency Relation
	imports 16 packages, and imported by 3 packages

Involved Source Files Package gocommand is a helper for calling the go command. vendor.go version.go
Package-Level Type Names (total 3, all are exported)
/* sort exporteds by: | */
An Invocation represents a call to the go command. Args []string BuildFlags []string If CleanEnv is set, the invocation will run only with the environment in Env, not starting with os.Environ. Env []string Logf func(format string, args ...interface{}) If ModFile is set, the go command is invoked with -modfile=ModFile. If ModFlag is set, the go command is invoked with -mod=ModFlag. If Overlay is set, the go command is invoked with -overlay=Overlay. Verb string WorkingDir string func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) func GoVersionOutput(ctx context.Context, inv Invocation, r *Runner) (string, error) func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, *ModuleJSON, error) func (*Runner).Run(ctx context.Context, inv Invocation) (*bytes.Buffer, error) func (*Runner).RunPiped(ctx context.Context, inv Invocation, stdout, stderr io.Writer) error func (*Runner).RunRaw(ctx context.Context, inv Invocation) (*bytes.Buffer, *bytes.Buffer, error, error) func golang.org/x/tools/go/internal/packagesdriver.GetSizesGolist(ctx context.Context, inv Invocation, gocmdRunner *Runner) (types.Sizes, error)
ModuleJSON holds information about a module. // directory holding files for this module, if any // path to go.mod file used when loading this module, if any // go version used in module // is this module only an indirect dependency of main module? // is this the main module? // module path // replaced by this module // time version was created // available update, if any (with -u) // module version // available module versions (with -versions) func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, *ModuleJSON, error)
An Runner will run go command invocations and serialize them if it sees a concurrency error. Run is a convenience wrapper around RunRaw. It returns only stdout and a "friendly" error. RunPiped runs the invocation serially, always waiting for any concurrent invocations to complete first. RunRaw runs the invocation, serializing requests only if they fight over go.mod changes. func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) func GoVersionOutput(ctx context.Context, inv Invocation, r *Runner) (string, error) func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (bool, *ModuleJSON, error) func golang.org/x/tools/go/internal/packagesdriver.GetSizesGolist(ctx context.Context, inv Invocation, gocmdRunner *Runner) (types.Sizes, error)
Package-Level Functions (total 8, in which 5 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
Package-Level Variables (total 3, in which 1 are exported)
DebugHangingGoCommands may be set by tests to enable additional instrumentation (including panics) for debugging hanging Go commands. See golang/go#54461 for details.
Package-Level Constants (only one, which is unexported)