Documentation ¶
Index ¶
- func CompareAPIVersions(path string, apiVersions pkgAPIVersions, inSH *internal.SymbolHistory) ([]string, error)
- func FeaturesForVersion(featureCtx map[string]map[string]bool, prevFeatureSet map[string]bool) (newFeatures []string, featureSet map[string]bool)
- func GenerateFeatureContexts(ctx context.Context, pkgPath, pkgDir string) (map[string]map[string]bool, error)
- func IntroducedHistory(sh *internal.SymbolHistory) (outSH *internal.SymbolHistory, err error)
- func LoadAPIFiles(pkgPath, dir string) ([]string, error)
- func ParsePackageAPIInfo(files []string) (_ apiVersions, err error)
- type Walker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAPIVersions ¶
func CompareAPIVersions(path string, apiVersions pkgAPIVersions, inSH *internal.SymbolHistory) ([]string, error)
CompareAPIVersions returns the differences between apiVersions and inVersionToNameToUnitSymbol.
func FeaturesForVersion ¶
func FeaturesForVersion(featureCtx map[string]map[string]bool, prevFeatureSet map[string]bool) (newFeatures []string, featureSet map[string]bool)
FeaturesForVersion returns the set of features introduced at a given version.
featureCtx contains all features at this version. prevFeatureSet contains all features in the previous version. newFeatures contains only features introduced at this version. allFeatures contains all features in the package at this version.
func GenerateFeatureContexts ¶
func GenerateFeatureContexts(ctx context.Context, pkgPath, pkgDir string) (map[string]map[string]bool, error)
GenerateFeatureContexts computes the exported API for the package specified by pkgPath. The source code for that package is in pkgDir.
It is largely adapted from https://go.googlesource.com/go/+/refs/heads/master/src/cmd/api/goapi.go.
func IntroducedHistory ¶
func IntroducedHistory(sh *internal.SymbolHistory) (outSH *internal.SymbolHistory, err error)
IntroducedHistory returns a map of the first version when a symbol name is added to the API, to the symbol name, to the UnitSymbol struct. The UnitSymbol.Children field will always be empty, as children names are also tracked.
func LoadAPIFiles ¶
LoadAPIFiles loads data about the API for the given package from dir.
func ParsePackageAPIInfo ¶
ParsePackageAPIInfo parses apiVersions using contents of the specified directory.
Types ¶
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker is the same as Walkter from https://go.googlesource.com/go/+/refs/heads/master/src/cmd/api/goapi.go, except Walker.stdPackages was renamed to Walker.packages.
func NewWalker ¶
NewWalker is the same as https://go.googlesource.com/go/+/refs/tags/go1.16.6/src/cmd/api/goapi.go#376, except w.context.Dir is set to pkgDir.