Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LocalVar = Rule{ Rule: name.Rule{ MaxLen: 30, Style: "lowerCamelCase", }, // contains filtered or unexported fields }
View Source
var Var = Rule{ Rule: name.Rule{ MaxLen: 40, Style: "camelCase", }, // contains filtered or unexported fields }
Functions ¶
func Check ¶
Example ¶
var src = `package example var V = 1 func F(arg1, Arg2 int) { const c = 2 var V int slice := []int{} for k, v := range slice { k = 5 } for k, v = range slice { } } ` problems.Clear() w := walker.Parse("example.go", src) w.Walk(func(isLocal bool, node ast.Node) { Check(isLocal, node, w.FileSet) }) problems.Render()
Output: +-----------------+-----------------------------------------------------+----------------+ | position | problem | rule | +-----------------+-----------------------------------------------------+----------------+ | example.go:3:14 | func param name Arg2 should be lowerCamelCase style | localVar.style | | example.go:5:7 | local var name V should be lowerCamelCase style | localVar.style | +-----------------+-----------------------------------------------------+----------------+
Types ¶
Click to show internal directories.
Click to hide internal directories.