Permalink
Browse files

Use new lint API

  • Loading branch information...
1 parent 5bf56c2 commit 785f2adbeecfb675c110966bb69792863aa0aa49 @dominikh committed Nov 19, 2016
Showing with 8 additions and 2 deletions.
  1. +1 −1 cmd/gosimple/gosimple.go
  2. +6 −0 lint.go
  3. +1 −1 lint_test.go
@@ -8,5 +8,5 @@ import (
)
func main() {
- lintutil.ProcessArgs("gosimple", simple.Funcs, os.Args[1:])
+ lintutil.ProcessArgs("gosimple", simple.NewChecker(), os.Args[1:])
}
View
@@ -35,6 +35,12 @@ var Funcs = map[string]lint.Func{
"S1017": LintTrim,
}
+type Checker struct{}
+
+func NewChecker() *Checker { return &Checker{} }
+func (c *Checker) Init(*lint.Program) {}
+func (c *Checker) Funcs() map[string]lint.Func { return Funcs }
+
func LintSingleCaseSelect(f *lint.File) {
isSingleSelect := func(node ast.Node) bool {
v, ok := node.(*ast.SelectStmt)
View
@@ -7,5 +7,5 @@ import (
)
func TestAll(t *testing.T) {
- testutil.TestAll(t, Funcs, "")
+ testutil.TestAll(t, NewChecker(), "")
}

0 comments on commit 785f2ad

Please sign in to comment.