Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReportProblems ¶
func ReportProblems( pass *analysis.Pass, missingPackages []MissingPackageReport, missingInterfaces []MissingInterfaceReport, missingMethods []MissingMethodsReport, ignoreSet *util.IgnoreSet, )
ReportProblems reports all implements violations using the new pretty formatter. Supports @ignore directives for suppressing violations when needed.
Types ¶
type InterfaceMethod ¶
type InterfaceMethod struct {
Name string
Inputs []InterfaceType
Outputs []InterfaceType
}
InterfaceMethod FIXME store signature @immutable
type InterfaceModel ¶
type InterfaceModel struct {
Name string
Package string
Methods []InterfaceMethod
}
InterfaceModel @immutable
func LoadInterfaces ¶
func LoadInterfaces(pass *analysis.Pass, queries []annotations.InterfaceQuery) []*InterfaceModel
LoadInterfaces loads specified interfaces from the analysis pass
type InterfaceType ¶
InterfaceType @immutable @constructor extractTypesFromTuple, convertTypesToInterfaceType
type MethodType ¶
MethodType represents a type in method signature @immutable @constructor convertTypesToMethodType, extractMethodTypesFromTuple
type MissingInterfaceReport ¶
type MissingInterfaceReport struct {
InterfaceName string
PackageName string
TypeName string
Pos token.Pos
}
@immutable implements reporting.Violation
func FindMissingInterfaces ¶
func FindMissingInterfaces( annotations []annotations.ImplementsAnnotation, interfaces []*InterfaceModel, ) []MissingInterfaceReport
FindMissingInterfaces identifies annotations where the interface was not found
func (MissingInterfaceReport) GetCode ¶
func (v MissingInterfaceReport) GetCode() string
GetCode returns the error code for this violation
func (MissingInterfaceReport) GetMessage ¶
func (v MissingInterfaceReport) GetMessage() string
GetMessage returns the main error message without formatting
func (MissingInterfaceReport) GetPos ¶
func (v MissingInterfaceReport) GetPos() token.Pos
GetPos returns the position of the violation
type MissingMethodsReport ¶
type MissingMethodsReport struct {
InterfaceName string
PackageName string
TypeName string
Methods []InterfaceMethod // Full method signatures
Pos token.Pos
}
@immutable implements reporting.Violation
func FindMissingMethods ¶
func FindMissingMethods( annotations []annotations.ImplementsAnnotation, interfaces []*InterfaceModel, types []*TypeModel, ) []MissingMethodsReport
FindMissingMethods identifies types that don't implement required interfaces
func (MissingMethodsReport) GetCode ¶
func (v MissingMethodsReport) GetCode() string
GetCode returns the error code for this violation
func (MissingMethodsReport) GetMessage ¶
func (v MissingMethodsReport) GetMessage() string
GetMessage returns the main error message without formatting
func (MissingMethodsReport) GetPos ¶
func (v MissingMethodsReport) GetPos() token.Pos
GetPos returns the position of the violation
type MissingPackageReport ¶
@immutable implements reporting.Violation
func FindMissingPackages ¶
func FindMissingPackages(annotations []annotations.ImplementsAnnotation) []MissingPackageReport
FindMissingPackages identifies annotations with unresolved package references
func (MissingPackageReport) GetCode ¶
func (v MissingPackageReport) GetCode() string
GetCode returns the error code for this violation
func (MissingPackageReport) GetMessage ¶
func (v MissingPackageReport) GetMessage() string
GetMessage returns the main error message without formatting
func (MissingPackageReport) GetPos ¶
func (v MissingPackageReport) GetPos() token.Pos
GetPos returns the position of the violation
type TypeMethod ¶
type TypeMethod struct {
Name string
Inputs []MethodType
Outputs []MethodType
ReceiverIsPointer bool // true if receiver is *T, false if T
}
TypeMethod represents a method of a type @immutable