Documentation ¶
Overview ¶
Package dep analyzes dependencies between values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶ added in v0.6.0
type Config struct { // Dynamic enables evaluting dependencies Vertex Arcs, recursively Dynamic bool // Descend enables recursively descending into fields. This option is // implied by Dynamic. Descend bool // Cycles allows a Node to reported more than once. This includes the node // passed to Visit, which is otherwise never reported. This option can be // used to disable cycle checking. TODO: this is not yet implemented. AllowCycles bool // Rootless enables reporting nodes that do not have a path from the root. // This includes variables of comprehensions and fields of composite literal // values that are part of expressions, such as {out: v}.out. Rootless bool // pkg indicates the main package for which the analyzer is configured, // which is used for reporting purposes. Pkg *adt.ImportReference }
type Dependency ¶
type Dependency struct { // Node is the referenced node. Node *adt.Vertex // Reference is the expression that referenced the node. Reference adt.Resolver // contains filtered or unexported fields }
A Dependency is a reference and the node that reference resolves to.
func (*Dependency) Import ¶
func (d *Dependency) Import() *adt.ImportReference
Import returns the import reference or nil if the reference was within the same package as the visited Vertex.
func (*Dependency) IsRoot ¶
func (d *Dependency) IsRoot() bool
IsRoot reports whether the dependency is referenced by the root of the original Vertex passed to any of the Visit* functions, and not one of its descendent arcs. This always returns true for Visit().
func (*Dependency) Recurse ¶ added in v0.6.0
func (d *Dependency) Recurse()
Recurse visits the dependencies of d.Node, using the same visit function as the original.
type VisitFunc ¶
type VisitFunc func(Dependency) error
VisitFunc is used for reporting dependencies.
Click to show internal directories.
Click to hide internal directories.