Documentation ¶
Index ¶
- Constants
- Variables
- func ImportPathToAssumedName(importPath string) (string, string)
- func IsExcludeGoListError(errMessage string) bool
- func IsGolangXPkg(pkg *Package) bool
- func IsStdlibPkg(pkg *Package) bool
- type BuildConfig
- type GoFile
- type ImportTree
- type JsonPackageError
- type MetaPackage
- type Module
- type ModuleError
- type Package
- type ReplacedFile
- type TCBadImportName
- type TCBadName
- type TCBadOther
- type TypeErrId
- type TypeError
Constants ¶
View Source
const CGO_PACKAGE_NAME = "C"
View Source
const GOLANGX_PATH_PREFIX = "golang.org/x/"
View Source
const UNSAFE_PACKAGE_NAME = "unsafe"
Variables ¶
View Source
var FileSet = token.NewFileSet()
Functions ¶
func ImportPathToAssumedName ¶
func IsExcludeGoListError ¶
func IsStdlibPkg ¶
Types ¶
type BuildConfig ¶
type GoFile ¶
type ImportTree ¶
type ImportTree struct {
// contains filtered or unexported fields
}
func List ¶
func List(paths []string) (ImportTree, error)
Use go-list to load all packages and build the initial tree
We load as many packages as we can at once - and pick up any "unimported" packages (packages that were imported by source files not marked for build under the present system) Any unimported packages we then go and load ourselves (and continue this process until all packages are loaded)
func (*ImportTree) Groups ¶
func (tree *ImportTree) Groups() [][]*Package
func (*ImportTree) Resolve ¶
func (tree *ImportTree) Resolve() error
Perform recursive DFS on the tree
During the search: - Build topology - Check for cycles - Build exported types for packages
type JsonPackageError ¶
type MetaPackage ¶
type MetaPackage 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 *JsonPackageError // error loading package DepsErrors []*JsonPackageError // 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 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 Meta *MetaPackage // Builds Builds []BuildConfig // Files Files map[string]*GoFile // Packages it is imported by Parents []*Package // Imported packages Imports map[string]*Package // Whether or not the package would actually get built in the default environment Included bool // Set if the packages source has changed Dirty bool // Set if a dependency (direct or in-direct) is dirty DepDirty bool // Set if the package has been modified manually Modified bool // Set if this is the first time the package is loaded FirstLoad bool // Any errors that occurred during load Errors []error // contains filtered or unexported fields }
func BackupNameLookup ¶
func (*Package) LoadSyntax ¶
func (*Package) LookupImport ¶
func (*Package) MarkModified ¶
func (pkg *Package) MarkModified()
type ReplacedFile ¶
type TCBadImportName ¶
type TCBadOther ¶
type TCBadOther struct{}
Click to show internal directories.
Click to hide internal directories.