package build

Import Path
	go/build (on golang.org and go.dev)

Dependency Relation
	imports 22 packages, and imported by 3 packages

Involved Source Files
	    build.go
	d-> doc.go
	    gc.go
	    read.go
	    syslist.go
	    zcgo.go

Exported Type Names

type Context (struct) A Context specifies the supporting context for a build. BuildTags []string CgoEnabled bool Compiler string Dir string GOARCH string GOOS string GOPATH string GOROOT string HasSubdir func(root, dir string) (rel string, ok bool) InstallSuffix string IsAbsPath func(path string) bool IsDir func(path string) bool JoinPath func(elem ...string) string OpenFile func(path string) (io.ReadCloser, error) ReadDir func(dir string) ([]os.FileInfo, error) ReleaseTags []string SplitPathList func(list string) []string UseAllFiles bool (*T) Import(path string, srcDir string, mode ImportMode) (*Package, error) (*T) ImportDir(dir string, mode ImportMode) (*Package, error) (*T) MatchFile(dir, name string) (match bool, err error) (*T) SrcDirs() []string func go/internal/srcimporter.New(ctxt *Context, fset *token.FileSet, packages map[string]*types.Package) *srcimporter.Importer var Default
type ImportMode uint An ImportMode controls the behavior of the Import method. func Import(path, srcDir string, mode ImportMode) (*Package, error) func ImportDir(dir string, mode ImportMode) (*Package, error) func (*Context).Import(path string, srcDir string, mode ImportMode) (*Package, error) func (*Context).ImportDir(dir string, mode ImportMode) (*Package, error) const AllowBinary const FindOnly const IgnoreVendor const ImportComment
type MultiplePackageError (struct) MultiplePackageError describes a directory containing multiple buildable Go source files for multiple packages. Dir string Files []string Packages []string (*T) Error() string *T : error
type NoGoError (struct) NoGoError is the error used by Import to describe a directory containing no buildable Go source files. (It may still contain test files, files hidden by build tags, and so on.) Dir string (*T) Error() string *T : error
Exported Values
const AllowBinary ImportMode = 2 If AllowBinary is set, Import can be satisfied by a compiled package object without corresponding sources. Deprecated: The supported way to create a compiled-only package is to write source code containing a //go:binary-only-package comment at the top of the file. Such a package will be recognized regardless of this flag setting (because it has source code) and will have BinaryOnly set to true in the returned Package.
func ArchChar(goarch string) (string, error) ArchChar returns "?" and an error. In earlier versions of Go, the returned string was used to derive the compiler and linker tool names, the default object file suffix, and the default linker output name. As of Go 1.5, those strings no longer vary by architecture; they are compile, link, .o, and a.out, respectively.
var Default Context Default is the default Context for builds. It uses the GOARCH, GOOS, GOROOT, and GOPATH environment variables if set, or else the compiled code's GOARCH, GOOS, and GOROOT.
const FindOnly ImportMode = 1 If FindOnly is set, Import stops after locating the directory that should contain the sources for a package. It does not read any files in the directory.
const IgnoreVendor ImportMode = 8 By default, Import searches vendor directories that apply in the given source directory before searching the GOROOT and GOPATH roots. If an Import finds and returns a package using a vendor directory, the resulting ImportPath is the complete path to the package, including the path elements leading up to and including "vendor". For example, if Import("y", "x/subdir", 0) finds "x/vendor/y", the returned package's ImportPath is "x/vendor/y", not plain "y". See golang.org/s/go15vendor for more information. Setting IgnoreVendor ignores vendor directories. In contrast to the package's ImportPath, the returned package's Imports, TestImports, and XTestImports are always the exact import paths from the source files: Import makes no attempt to resolve or check those paths.
func Import(path, srcDir string, mode ImportMode) (*Package, error) Import is shorthand for Default.Import.
const ImportComment ImportMode = 4 If ImportComment is set, parse import comments on package statements. Import returns an error if it finds a comment it cannot understand or finds conflicting comments in multiple source files. See golang.org/s/go14customimport for more information.
func ImportDir(dir string, mode ImportMode) (*Package, error) ImportDir is shorthand for Default.ImportDir.
func IsLocalImport(path string) bool IsLocalImport reports whether the import path is a local import path, like ".", "..", "./foo", or "../foo".
var ToolDir string ToolDir is the directory containing build tools.