Documentation ¶
Index ¶
- Variables
- func ClearGlobalpkgs()
- func FindImportName(file *ast.File, path string) *string
- func IsExcludeGoListError(errMessage string) bool
- type BuildConfig
- type ExtGoFile
- type GoFile
- type Importer
- type LoadOption
- type Module
- type ModuleError
- type Package
- type ProcGroup
- type RawPackage
- type RefType
- type TCBadImportName
- type TCBadName
- type TCBadOther
- type TypeErrId
- type TypeError
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildTags map[string]bool
View Source
var Goos string
These shouldn't change so we can have these as globals for easy reference
Functions ¶
func ClearGlobalpkgs ¶ added in v1.1.2
func ClearGlobalpkgs()
func FindImportName ¶
Find the local import name for an import path
func IsExcludeGoListError ¶ added in v1.1.2
Types ¶
type BuildConfig ¶
type LoadOption ¶
type LoadOption uint
Additional configuration options for load behaviour
const ( LoadHaltMistyped LoadOption = 1 << iota // Halt loading on mistyped (reserved for stdlib packages) LoadAllConfigs // Load all source files and parse configs )
type Module ¶
type Module struct { Path string // module path // Query string // version query corresponding to this version Version string // module version // Versions []string // available module versions Replace *Module // replaced by this module // Time *time.Time // time version was created // Update *Module // available update (with -u) Main bool // is this the main module? Indirect bool // module is only indirectly needed by main module Dir string // directory holding local copy of files, if any GoMod string // path to go.mod file describing module, if any GoVersion string // go version used in module // Retracted []string // retraction information, if any (with -retracted or -u) // Deprecated string // deprecation message, if any (with -u) Error *ModuleError // error loading module }
type ModuleError ¶
type ModuleError struct {
Err string // the error itself
}
type Package ¶
type Package struct { // Metadata Dir string ImportPath string Name string Goroot bool Export string Module *Module // Layer the package is on Layer *ProcGroup // Used in / Imported packages Parents []*Package Imports map[string]*Package // Build Configurations // // Index 0 is the default build configuration // The rest are ordered using the most generic unix-like ordering (see tags.go) Configs []BuildConfig // Active config // // Config to use when attempting a build CfgIdx int // Map file names and their import names to paths FileImports map[string]map[string]string // Fileset for loading all files for this package Fset *token.FileSet // Whether or not the package would actually get built in the default environment Active bool // Flags used for external processing (the porting package uses this, has no impact on load) ExtFlags uint8 // Partially loaded type data Types *types.Package // Any errors that occurred during load Errors []error // contains filtered or unexported fields }
func (*Package) Build ¶
func (pkg *Package) Build(importer Importer, handleErr func(err TypeError)) (*types.Package, []TypeError)
Build the package
The package will be built according to the specified config (Package.Configs[Package.CfgIdx])
Pass in a non-nil importer function to override import calls Pass in a non-nil handleErr function to handle error calls as they appear
func (*Package) LoadSyntax ¶
type ProcGroup ¶
func Load ¶
func Load(paths []string, getOpts func(RawPackage, bool) (LoadOption, error)) (*ProcGroup, error)
type RawPackage ¶
type RawPackage struct { Dir string // directory containing package sources ImportPath string // import path of package in dir // ImportComment string // path in import comment on package statement Name string // package name // Shlib string // the shared library that contains this package (only set when -linkshared) Goroot bool // is this package in the Go root? Standard bool // is this package part of the standard Go library? // Stale bool // would 'go install' do anything for this package? // StaleReason string // explanation for Stale==true // Root string // Go root or Go path dir containing this package // ConflictDir string // this directory shadows Dir in $GOPATH // BinaryOnly bool // binary-only package (no longer supported) // ForTest string // package is only for use in named test Export string // file containing export data (when using -export) // BuildID string // build ID of the compiled package (when using -export) Module *Module // info about package's containing module, if any (can be nil) Match []string // command-line patterns matching this package DepOnly bool // package is only a dependency, not explicitly // Source files GoFiles []string // .go source files (excluding CgoFiles, TestGoFiles, XTestGoFiles) CgoFiles []string // .go source files that import "C" // CompiledGoFiles []string // .go files presented to compiler (when using -compiled) IgnoredGoFiles []string // .go source files ignored due to build constraints // Dependency information Imports []string // import paths used by this package ImportMap map[string]string // map from source import to ImportPath (identity entries omitted) // Error information Incomplete bool // this package or a dependency has an error Error *rawPackageError // error loading package DepsErrors []*rawPackageError // errors loading dependencies }
Fields that are commented out are provided by go-list however that are not need by wharf so leave them commented out in case they ever do become useful
type TCBadImportName ¶
type TCBadOther ¶
type TCBadOther struct{}
Click to show internal directories.
Click to hide internal directories.