Documentation
¶
Index ¶
- func IsStd(p *packages.Package) bool
- func IsStdName(id string) bool
- func IsTestPkg(pkg *packages.Package) bool
- func KeyValue(s string) (string, string)
- func LoadStd()
- func Parse(_ context.Context, expr []string) (ast.Expr, error)
- type Context
- func (ctx Context) Clone() *Context
- func (ctx Context) Config() *packages.Config
- func (ctx Context) Load(patterns ...string) ([]*packages.Package, error)
- func (ctx Context) LoadWithTests(patterns ...string) ([]*packages.Package, error)
- func (ctx Context) LoadWithoutTests(patterns ...string) ([]*packages.Package, error)
- func (ctx *Context) Set(key, value string)
- type Set
- func Calc(parentContext context.Context, expr []string) (Set, error)
- func Deadcode(ctx *Context, pkgs Set) (Set, error)
- func DirectDependencies(a Set) Set
- func Incoming(a, b Set) Set
- func Intersect(a, b Set) Set
- func Main(a Set) Set
- func ModuleDependencies(a Set) Set
- func New(roots ...*packages.Package) Set
- func NewAll(src Set) Set
- func NewRoot(roots ...*packages.Package) Set
- func Reach(a, b Set) Set
- func Sources(a Set) Set
- func Std() Set
- func Subtract(a, b Set) Set
- func SymmetricDifference(a, b Set) Set
- func Test(a Set) Set
- func Transitive(a Set) Set
- func Union(a, b Set) Set
- func UnionAll(xs ...Set) Set
- func (set Set) Clone() Set
- func (set Set) IDs() []string
- func (set Set) IncludeRecursive(p *packages.Package)
- func (set Set) List() []*packages.Package
- func (set Set) Sorted() []*packages.Package
- func (set Set) Walk(fn func(*packages.Package))
- func (set Set) WalkAllDependencies(fn func(*packages.Package))
- type Strings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
func (Context) LoadWithTests ¶ added in v0.4.2
func (Context) LoadWithoutTests ¶ added in v0.4.2
type Set ¶
Set is a p.ID -> *packages.Package
func Deadcode ¶ added in v0.9.0
Deadcode returns packages from the set that directly or indirectly call a function annotated with <ReflectMethod> in the linker dependency graph. This is typically caused by reflect.Value.MethodByName or similar calls, which force the linker to keep all interface methods alive.
func DirectDependencies ¶
DirectDependencies returns packages that are direct dependencies of a, `a` not included.
func ModuleDependencies ¶ added in v0.6.0
ModuleDependencies returns packages that are direct or indirect dependencies of a, which are part of modules of package a.
func Sources ¶
Sources returns packages that don't have incoming edges, only considering edges between packages in the set.
func SymmetricDifference ¶
SymmetricDifference returns packages that are different
func (Set) IncludeRecursive ¶
IncludeRecursive adds p recursively
func (Set) WalkAllDependencies ¶ added in v0.7.1
WalkAllDependencies walks all dependencies of the set, including ones not part of the set.