trace

package
v3.9.0-0.36.0+incompat... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

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 Package

type Package struct {
	Dir         string
	ImportPath  string
	Imports     []string
	TestImports []string
}

type PackageList

type PackageList struct {
	Packages []Package
}

func (*PackageList) Add

func (p *PackageList) Add(pkg Package)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL