Documentation ¶
Overview ¶
Package affiliation implements the affliation analyzer that tries to find the concrete implementation of an interface and create full triggers for them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Analyzer = &analysis.Analyzer{ Name: "nilaway_affiliation_analyzer", Doc: _doc, Run: analysishelper.WrapRun(run), FactTypes: []analysis.Fact{new(AffliliationCache)}, ResultType: reflect.TypeOf((*analysishelper.Result[[]annotation.FullTrigger])(nil)), Requires: []*analysis.Analyzer{config.Analyzer}, }
Analyzer here is the analyzer that tracks interface implementations and analyzes for nilability variance, and passes them onto the accumulator to be added to existing assertions to be matched against annotations.
Functions ¶
This section is empty.
Types ¶
type Affiliation ¶
type Affiliation struct {
// contains filtered or unexported fields
}
Affiliation is used to track the association between an interface and its concrete implementations in the form of a map, where the key is a function where the affiliation was witnessed and value is an array of full triggers computed for the affiliation key
type AffliliationCache ¶
type AffliliationCache struct {
Cache ImplementedDeclaredTypesCache
}
AffliliationCache stores the mapping between interfaces and their implementations that have been analyzed. This information can be used by downstream packages to avoid re-analysis of the same affiliations
func (*AffliliationCache) AFact ¶
func (*AffliliationCache) AFact()
AFact enables use of the facts passing mechanism in Go's analysis framework
type ImplementedDeclaredTypesCache ¶
ImplementedDeclaredTypesCache declares a map of a concrete implementation (e.g., struct) and its implemented interfaces in the form of their fully qualified paths (key: <structFQ>#<interfaceFQ>, value: true/false)