Documentation
¶
Overview ¶
Package packages provides Go package traversal in a Bazel repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Walk ¶
Walk walks through directories under "root". It calls back "f" for each package.
It is similar to "golang.org/x/tools/go/buildutil".ForEachPackage, but it does not assume the standard Go tree because Bazel rules_go uses go_prefix instead of the standard tree.
If a directory contains no buildable Go code, "f" is not called. If a directory contains one package with any name, "f" will be called with that package. If a directory contains multiple packages and one of the package names matches the directory name, "f" will be called on that package and the other packages will be silently ignored. If none of the package names match the directory name, a *build.MultiplePackageError error is returned.
Types ¶
type Package ¶
Package contains metadata about a Go package extracted from a directory. It fills a similar role to go/build.Package, but it separates files by target instead of by type, and it supports multiple platforms.
type PlatformStrings ¶
type PlatformStrings struct { // Generic is a list of strings not specific to any platform. Generic []string // Platform is a map of lists of platform-specific strings. The map is keyed // by the name of the platform. Platform map[string][]string }
PlatformStrings contains a set of strings associated with a buildable Go target in a package. This is used to store source file names, import paths, and flags.
func (*PlatformStrings) HasGo ¶
func (ts *PlatformStrings) HasGo() bool
func (*PlatformStrings) IsEmpty ¶
func (ts *PlatformStrings) IsEmpty() bool
type Target ¶
type Target struct {
Sources, Imports PlatformStrings
COpts, CLinkOpts PlatformStrings
}
Target contains metadata about a buildable Go target in a package.