github.com/golangci/go-tools@v0.0.0-20190318060251-af6baa5dc196/cmd/staticcheck/staticcheck.go (about)

     1  // staticcheck analyses Go code and makes it better.
     2  package main // import "github.com/golangci/go-tools/cmd/staticcheck"
     3  
     4  import (
     5  	"os"
     6  
     7  	"github.com/golangci/go-tools/lint"
     8  	"github.com/golangci/go-tools/lint/lintutil"
     9  	"github.com/golangci/go-tools/simple"
    10  	"github.com/golangci/go-tools/staticcheck"
    11  	"github.com/golangci/go-tools/stylecheck"
    12  	"github.com/golangci/go-tools/unused"
    13  )
    14  
    15  func main() {
    16  	fs := lintutil.FlagSet("staticcheck")
    17  	fs.Parse(os.Args[1:])
    18  
    19  	checkers := []lint.Checker{
    20  		simple.NewChecker(),
    21  		staticcheck.NewChecker(),
    22  		stylecheck.NewChecker(),
    23  	}
    24  
    25  	uc := unused.NewChecker(unused.CheckAll)
    26  	uc.ConsiderReflection = true
    27  	checkers = append(checkers, unused.NewLintChecker(uc))
    28  
    29  	lintutil.ProcessFlagSet(checkers, fs)
    30  }