Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildGraph ¶
func BuildGraph(packages *PackageList, excludes []string) (*depgraph.MutableDirectedGraph, error)
BuildGraph receives a list of Go packages and constructs a dependency graph from it. Any core library dependencies (fmt, strings, etc.) are not added to the graph. Any packages whose import path is contained within a list of "excludes" are not added to the graph. Returns a directed graph and a map of package import paths to node ids, or an error.
func FilterPackages ¶
func FilterPackages(g *depgraph.MutableDirectedGraph, packagePrefixes []string) (*depgraph.MutableDirectedGraph, error)
FilterPackages receives a graph and a set of packagePrefixes contained within the graph. Returns a new graph with the sub-tree for each node matching the packagePrefix collapsed into just that node. Relationships among packagePrefixes are kept: edges originating from packagePrefix subpackages are re-written to originate from the packagePrefix, and edges terminating at packagePrefix subpackages are re-written to terminate at the packagePrefix.
Types ¶
type PackageList ¶
type PackageList struct {
Packages []Package
}
func (*PackageList) Add ¶
func (p *PackageList) Add(pkg Package)