Documentation ¶
Overview ¶
Package packages implements support for loading packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Module ¶ added in v0.3.0
type Module struct { Path string // module path Version string // module version Time *time.Time // time version was created Dir string // directory holding files for this module, if any Packages []*Package // packages belonging to the module }
A Module describes a package's containing module.
func LoadModule ¶ added in v0.3.0
LoadModule loads and return the module named by pattern and all its packages.
type Package ¶
type Package struct { Dir string // directory containing package sources ImportPath string // import path of package in dir Name string // package name Module *Module // info about package's containing module, if any (can be nil) // Source files GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles) CgoFiles []string // .go sources files that import "C" IgnoredGoFiles []string // .go sources ignored due to build constraints // Test information TestGoFiles []string // _test.go files in package XTestGoFiles []string // _test.go files outside package }
A Package describes a single package found in a directory.
func Load ¶
Load loads and return the package named by the given pattern.
If more than one package matches the pattern, only the first one is returned.
Load returns at least one package or an error.
func (*Package) SourceFiles ¶
SourceFiles returns all the .go files, including files ignored due to build constraints.
Click to show internal directories.
Click to hide internal directories.