Documentation
¶
Overview ¶
Package analyzer provides utilities for loading and analyzing Go packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrPackagesContainErrors = errors.New("packages contain errors")
ErrPackagesContainErrors is returned when loaded packages have errors.
Functions ¶
func CollectSymbols ¶
CollectSymbols extracts symbol definitions and usages from a package. Returns two maps: defined symbols and used symbols from other packages.
func LoadPackages ¶
func LoadPackages(dir string, overlay map[string][]byte, patterns ...string) ([]*packages.Package, error)
LoadPackages loads Go packages with full type information.
func ObjectKind ¶
ObjectKind returns a string representation of the object kind.
Types ¶
type Symbol ¶
type Symbol struct {
ID string // "pkg/path.SymbolName".
Name string // Symbol name.
Package string // Package path.
Kind string // "func", "type", "var", "const".
File string // Defining file path.
Pos token.Position // Source position.
}
Symbol represents a symbol (function, type, variable, constant) in Go code.
Click to show internal directories.
Click to hide internal directories.