Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StructConstructor ¶
type StructConstructor struct {
// contains filtered or unexported fields
}
func NewStructConstructor ¶
func NewStructConstructor(funcDec *ast.FuncDecl) (StructConstructor, bool)
func (StructConstructor) GetConstructor ¶
func (sc StructConstructor) GetConstructor() *ast.FuncDecl
func (StructConstructor) GetStructReturn ¶
func (sc StructConstructor) GetStructReturn() *ast.Ident
GetStructReturn Return the struct linked to this "constructor".
type StructHolder ¶
type StructHolder struct { // The features to be analyzed Features features.Feature // The struct declaration Struct *ast.TypeSpec // A Struct constructor is considered if starts with `New...` and the 1st output parameter is a struct Constructors []*ast.FuncDecl // Struct methods StructMethods []*ast.FuncDecl }
StructHolder contains all the information around a Go struct.
func (*StructHolder) AddConstructor ¶
func (sh *StructHolder) AddConstructor(fn *ast.FuncDecl)
func (*StructHolder) AddMethod ¶
func (sh *StructHolder) AddMethod(fn *ast.FuncDecl)
func (*StructHolder) Analyze ¶
func (sh *StructHolder) Analyze() []analysis.Diagnostic
Click to show internal directories.
Click to hide internal directories.