Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzerContext ¶
type AnalyzerContext struct {
// Fset holds the parsed file set for position information.
Fset *token.FileSet
// Types contains type-checker results.
Types *types.Info
// SSA contains the SSA function representation of the current package.
SSA *ssa.Package
// Filename represents the absolute or relative path of the file being analyzed.
Filename string
// PackageName is the Go package name.
PackageName string
// Source holds the entire source code of the file (optional, useful for highlighting).
Source []byte
// CustomData is a generic key-value map that allows analyzers to store state.
CustomData map[string]any
}
AnalyzerContext represents the shared context used during all analysis phases.
func NewAnalyzerContext ¶
func NewAnalyzerContext( fset *token.FileSet, typesInfo *types.Info, ssaPkg *ssa.Package, filename string, packageName string, source []byte, ) *AnalyzerContext
NewAnalyzerContext creates a new AnalyzerContext instance.
func (*AnalyzerContext) GetCustom ¶
func (ctx *AnalyzerContext) GetCustom(key string) (any, bool)
GetCustom retrieves a value from the CustomData map.
func (*AnalyzerContext) SetCustom ¶
func (ctx *AnalyzerContext) SetCustom(key string, value any)
SetCustom sets a value in the CustomData map.
Click to show internal directories.
Click to hide internal directories.