Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrLoadFailed = errors.New("callgraph: go/packages load failed")
ErrLoadFailed is the exported sentinel returned when go/packages fails to load any usable package. Callers catch it via errors.Is and fall back to the gopls --calls tier (never a hard CLI error).
Functions ¶
This section is empty.
Types ¶
type CallEdge ¶
type CallEdge struct {
CallerFile, CallerSymbol string
CallerLine int
CalleeFile, CalleeSymbol string
}
CallEdge is one resolved caller→callee relationship in the typed call graph. It carries enough structure to build SymbolCallers via the root package's TypedGraphToSymbolCallers adapter (Decision 3).
func Build ¶
Build returns the type-checked whole-program call graph for the module rooted at root, computed with go/packages (LoadSyntax) → go/ssa → Class Hierarchy Analysis (precise-callgraph.md Decisions 1 and 2).
Loading is fail-open: a package with type errors is skipped with a single stderr warning and the remaining packages are still analyzed. Only a total failure — packages.Load returning an error, or zero usable packages — returns ErrLoadFailed, which the caller catches to fall back to the gopls --calls tier.