Documentation ¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checker ¶
type Checker struct { Violations []Violation // List of available violations Packages map[string][]int // Storing indexes of Violations per pkg/kg.Struct Type func(ast.Expr) string // Type Checker closure. Print func(ast.Node) []byte // String representation of the expression. }
Checker will perform standard check on package and its methods.
type Generate ¶
type Generate struct { SkipGenerate bool PreCondition string // Precondition we want to be generated Pattern string // Generate pattern (for the `want` message) Returns []string // ReturnTypes as slice }
Tests (generation) related struct.
type GolangIssue ¶ added in v0.2.0
type Import ¶
Imports represents an imported package in a nice for lookup way...
examples: import . "bytes" -> checker.Import{Pkg:"bytes", Val:"."} import name "bytes" -> checker.Import{Pkg:"bytes", Val:"name"}
type Violation ¶
type Violation struct { Type ViolationType // Args []int // Indexes of the arguments needs to be checked ArgsType string Targets string Package string AltPackage string Struct string Caller string AltCaller string // --- tests generation information Generate *Generate // contains filtered or unexported fields }
Violation describes what message we going to give to a particular code violation
func (*Violation) Diagnostic ¶
func (v *Violation) Diagnostic(fSet *token.FileSet) analysis.Diagnostic
type ViolationType ¶
type ViolationType int
Type of violation: can be method or function
const ( Function ViolationType = iota + 1 Method )
Click to show internal directories.
Click to hide internal directories.