Documentation
¶
Overview ¶
Package gocommand is a helper for calling the go command.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Invocation ¶
type Invocation struct {
Verb string
Args []string
BuildFlags []string
Env []string
WorkingDir string
Logf func(format string, args ...interface{})
}
An Invocation represents a call to the go command.
type ModuleJSON ¶
type ModuleJSON struct {
Path string // module path
Replace *ModuleJSON // replaced by this module
Main bool // is this the main module?
Indirect bool // is this module only an indirect dependency of main module?
Dir string // directory holding files for this module, if any
GoMod string // path to go.mod file for this module, if any
GoVersion string // go version used in module
}
ModuleJSON holds information about a module.
func VendorEnabled ¶
func VendorEnabled(ctx context.Context, inv Invocation, r *Runner) (*ModuleJSON, bool, error)
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
Click to show internal directories.
Click to hide internal directories.