Documentation ¶
Overview ¶
Package pkgload is a set of utilities for `go/packages` load-related operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deduplicate ¶
Deduplicate returns a copy of pkgs slice where all duplicated package entries are removed.
Packages are considered equal if all conditions below are satisfied:
- Same ID
- Same Name
- Same PkgPath
- Equal GoFiles
func VisitUnits ¶
VisitUnits traverses potentially unsorted pkgs list as a set of units. All related packages from the slice are passed into visit func as a single unit. Units are visited in a sorted order (import path).
All packages in a slice must be non-nil.
Types ¶
type Unit ¶
type Unit struct { // Base is a standard (normal) package. Base *packages.Package // Test is a package compiled for test. // Can be nil. Test *packages.Package // ExternalTest is a "_test" compiled package. // Can be nil. ExternalTest *packages.Package // TestBinary is a test binary. // Non-nil if Test or ExternalTest are present. TestBinary *packages.Package }
Unit is a set of packages that form a logical group.
Click to show internal directories.
Click to hide internal directories.