load

package
v7.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package load loads packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMetaPackage

func IsMetaPackage(name string) bool

IsMetaPackage checks if name is a reserved package name that expands to multiple packages.

Types

type Context

type Context struct {
	// BuildContext is the build context to use.
	BuildContext build.Context

	// GOROOTsrc is the location of the src directory in GOROOT.
	// At this time, it's used only in MatchPackages to skip
	// GOOROOT/src entry from BuildContext.SrcDirs output.
	GOROOTsrc string
}

Context specifies values for operation of ImportPaths that would otherwise come from cmd/go/internal/cfg package.

This is a construct added for gotool purposes and doesn't have an equivalent upstream in cmd/go.

func (*Context) ImportPaths

func (c *Context) ImportPaths(args []string) []string

ImportPaths returns the import paths to use for the given command line.

func (*Context) ImportPathsNoDotExpansion

func (c *Context) ImportPathsNoDotExpansion(args []string) []string

ImportPathsNoDotExpansion returns the import paths to use for the given command line, but it does no ... expansion.

func (*Context) MatchPackages

func (c *Context) MatchPackages(pattern string) []string

MatchPackages returns a list of package paths matching pattern (see go help packages for pattern syntax).

func (*Context) MatchPackagesInFS

func (c *Context) MatchPackagesInFS(pattern string) []string

MatchPackagesInFS returns a list of package paths matching pattern, which must begin with ./ or ../ (see go help packages for pattern syntax).

Jump to

Keyboard shortcuts

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