Documentation
¶
Overview ¶
Package callpath finds static call paths between Go functions.
It builds a class hierarchy analysis call graph, which counts every method of a matching type as a possible callee of an interface call. The paths are therefore a superset of the real ones: a path found may never run, but a call path missing from the output does not exist in the loaded code.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// Dir is the directory the package patterns resolve from.
Dir string
// Patterns are the package patterns to load, as for go build.
Patterns []string
// Tests also loads the test files of the matched packages.
Tests bool
// From matches the full SSA names of the functions the paths start from.
From *regexp.Regexp
// To matches the full SSA names of the functions the paths end at.
To *regexp.Regexp
// Within matches the package paths a path may pass through. A target may
// lie outside them. Nil keeps a path inside the modules of the loaded
// packages.
Within *regexp.Regexp
}
Options configures a call path search.
type Path ¶
type Path []string
Path is one call path, from its root to its target, as full SSA names.
type Result ¶
type Result struct {
// Modules are the module paths of the loaded packages.
Modules []string
// Roots is the number of functions From matched.
Roots int
// Paths are the shortest path from each root to each target it reaches,
// sorted.
Paths []Path
}
Result is the outcome of a search.
Click to show internal directories.
Click to hide internal directories.