Documentation ¶
Index ¶
Constants ¶
View Source
const ( Strings string = "string" Bytes string = "[]byte" )
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 expresion. }
Checker will perform standart check on package and its methods.
type Generate ¶
type Generate struct { PreCondition string // Precondition we want to be generated Pattern string // Generate pattern (for the `want` message) Returns int // Expected to return n elements }
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 Targets string Package string AltPackage string Struct string Caller string AltCaller string // --- tests generation information Generate *Generate // contains filtered or unexported fields }
Violation describs 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.