Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultGoPkgExcludeMatcher ¶
DefaultGoPkgExcludeMatcher returns a matcher that matches names that standard Go tools generally exclude as Go packages. This includes hidden directories, directories named "testdata" and directories that start with an underscore.
Types ¶
type Packages ¶
type Packages interface { RootDir() string Packages(pathType Type) (map[string]string, error) Paths(pathType Type) ([]string, error) Filter(exclude matcher.Matcher) (Packages, error) }
func PackagesFromPaths ¶
PackagesFromPaths creates a Packages using the provided relative paths. If any of the relative paths end in a splat ("/..."), then all of the sub-directories of that directory are also considered.
func PackagesInDir ¶
PackagesInDir creates a Packages that contains all of the packages rooted at the provided directory. Every directory rooted in the provided directory whose path does not match the provided exclude matcher is considered as a package.
type PkgPather ¶
type PkgPather interface { Abs() string GoPathSrcRel() (string, error) Rel(root string) (string, error) }
func NewAbsPkgPath ¶
func NewGoPathSrcRelPkgPath ¶
func NewRelPkgPath ¶
type Type ¶
type Type int
const ( // Absolute is the absolute path to a package, e.g.: /Volumes/git/go/src/github.com/org/project Absolute Type = iota // GoPathSrcRelative is the path to a package relative to "$GOPATH/src", e.g.: github.com/org/project. Is the // file path rather than the import path, so includes vendor directories in path, e.g.: // github.com/org/project/vendor/github.com/other/project GoPathSrcRelative // Relative is the relative path to a package relative to a directory. Always includes the "./" prefix, e.g.: // ./., ./app/main. Relative )