Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Const = Rule{ Rule: namepkg.Rule{ MaxLen: 40, Style: "camelCase", }, // contains filtered or unexported fields }
View Source
var LocalConst = Rule{ Rule: namepkg.Rule{ MaxLen: 30, Style: "lowerCamelCase", }, // contains filtered or unexported fields }
Functions ¶
func Check ¶
Example ¶
var src = `package example const C = 3 func F() { const c, ConstName = 3, 4 var v = 5 } ` 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:4:12 | local const name ConstName should be lowerCamelCase style | localConst.style | +-----------------+-----------------------------------------------------------+------------------+
Types ¶
Click to show internal directories.
Click to hide internal directories.