// 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. const AllowBinary = iota


// 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 FindOnly = iota


// 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. const IgnoreVendor = iota


// 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. const ImportComment = iota


// 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. var Default = defaultContext()


var Sfiles []string


// ToolDir is the directory containing build tools. var ToolDir = getToolDir()


// 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. func ArchChar(goarch string) (string, error)


// Import is shorthand for Default.Import. func Import(path string, srcDir string, mode ImportMode) (*Package, error)


// ImportDir is shorthand for Default.ImportDir. func ImportDir(dir string, mode ImportMode) (*Package, error)


// IsLocalImport reports whether the import path is // a local import path, like ".", "..", "./foo", or "../foo". func IsLocalImport(path string) bool