package load

import "github.com/kisielk/gotool/internal/load"

Package load loads packages.

Index

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).

Source Files

path.go pkg.go search.go

Version
v1.0.0 (latest)
Published
Feb 21, 2018
Platform
darwin/amd64
Imports
8 packages
Last checked
7 minutes ago

Tools for package owners.