Documentation ¶
Overview ¶
Package gotool contains utility functions used to implement the standard "cmd/go" tool, provided as a convenience to developers who want to write tools with similar semantics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultContext = Context{ BuildContext: build.Default, }
DefaultContext is the default context that uses build.Default.
Functions ¶
func ImportPaths ¶
ImportPaths returns the import paths to use for the given command line using default context.
The path "all" is expanded to all packages in $GOPATH and $GOROOT. The path "std" is expanded to all packages in the Go standard library. The path "cmd" is expanded to all Go standard commands. The string "..." is treated as a wildcard within a path. When matching recursively, directories are ignored if they are prefixed with a dot or an underscore (such as ".foo" or "_foo"), or are named "testdata". Relative import paths are not converted to full import paths. If args is empty, a single element "." is returned.
Types ¶
type Context ¶
type Context struct { // BuildContext is the build.Context that is used when computing import paths. BuildContext build.Context }
A Context specifies the supporting context.
func (*Context) ImportPaths ¶
ImportPaths returns the import paths to use for the given command line.
The path "all" is expanded to all packages in $GOPATH and $GOROOT. The path "std" is expanded to all packages in the Go standard library. The path "cmd" is expanded to all Go standard commands. The string "..." is treated as a wildcard within a path. When matching recursively, directories are ignored if they are prefixed with a dot or an underscore (such as ".foo" or "_foo"), or are named "testdata". Relative import paths are not converted to full import paths. If args is empty, a single element "." is returned.