Documentation ¶
Overview ¶
Package load loads local modules.
A local module is a module whose module path, as defined in the module directive in go.mod, is inside $GOPATH.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶
type Module struct { Path string // module path Version string // module version, always empty Main bool // is this the main module? Dir string // directory holding files for this module GoMod string // path to go.mod file for this module GoVersion string // go version used in module Root string // Go path dir containing this module Error *ModuleError // error loading module }
Module represents a local module.
func Modules ¶
Modules returns the modules named by the command line argument arg. If a named module cannot be loaded at all (for example, if the go.mod file has problems), then Modules prints an error and does not include that module in the results.
func ModulesAndErrors ¶
ModulesAndErrors is like Modules but returns a *Module for every argument, even the ones that cannot be loaded at all. The modules that fail to load will have m.Error != nil.
type ModuleError ¶
type ModuleError struct {
Err string // the error itself
}
ModuleError represents a module error.
func (*ModuleError) Error ¶
func (me *ModuleError) Error() string
Error implements the error interface.