Documentation
¶
Overview ¶
Package goload loads the Go packages of an app for the compiler and the analyzers.
go/packages can type-check a module, but with an overlay it loads every dependency from source: the standard library and each module the app needs. The compiler always has an overlay, so each analysis parsed and checked all of that again (NFR-05). This loader lists the packages with go/packages, type-checks the packages of the app from source and reads each dependency from the export data that the Go build cache holds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
// Dir is the directory of the app.
Dir string
// contains filtered or unexported fields
}
Loader loads the packages below one directory. It keeps the export file of each dependency, so a second load of the same app lists them one time.
func (*Loader) Load ¶
Load lists the packages that "./..." names below Dir and type-checks them from source. overlay holds file contents that replace or add files. Each returned package has Fset, Syntax, Types, TypesInfo and TypeErrors. A package that the returned ones import has Types and no Syntax.