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.)
(*T) Error() string
*T : error
const AllowBinaryImportMode = 2
If AllowBinary is set, Import can be satisfied by a compiled
package object without corresponding sources.
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.
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 FindOnlyImportMode = 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 IgnoreVendorImportMode = 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.
const ImportCommentImportMode = 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 IsLocalImport(path string) bool
IsLocalImport reports whether the import path is
a local import path, like ".", "..", "./foo", or "../foo".
ToolDir is the directory containing build tools.
The pages are generated with Goldsv0.1.6-preview. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project and developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.