load

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

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

func Modules(arg string) []*Module

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

func ModulesAndErrors(pattern string) []*Module

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.

func (*Module) Name

func (m *Module) Name() string

Name returns the short name of the module.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL