2019-02-18 20:32:41 +01:00
|
|
|
// staticcheck analyses Go code and makes it better.
|
2018-12-31 02:18:41 +01:00
|
|
|
package main // import "honnef.co/go/tools/cmd/staticcheck"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2019-02-18 20:32:41 +01:00
|
|
|
"honnef.co/go/tools/lint"
|
2018-12-31 02:18:41 +01:00
|
|
|
"honnef.co/go/tools/lint/lintutil"
|
2019-02-18 20:32:41 +01:00
|
|
|
"honnef.co/go/tools/simple"
|
2018-12-31 02:18:41 +01:00
|
|
|
"honnef.co/go/tools/staticcheck"
|
2019-02-18 20:32:41 +01:00
|
|
|
"honnef.co/go/tools/stylecheck"
|
|
|
|
"honnef.co/go/tools/unused"
|
2018-12-31 02:18:41 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
fs := lintutil.FlagSet("staticcheck")
|
|
|
|
fs.Parse(os.Args[1:])
|
2019-02-18 20:32:41 +01:00
|
|
|
|
|
|
|
checkers := []lint.Checker{
|
|
|
|
simple.NewChecker(),
|
|
|
|
staticcheck.NewChecker(),
|
|
|
|
stylecheck.NewChecker(),
|
2018-12-31 02:18:41 +01:00
|
|
|
}
|
2019-02-18 20:32:41 +01:00
|
|
|
|
|
|
|
uc := unused.NewChecker(unused.CheckAll)
|
|
|
|
uc.ConsiderReflection = true
|
|
|
|
checkers = append(checkers, unused.NewLintChecker(uc))
|
|
|
|
|
|
|
|
lintutil.ProcessFlagSet(checkers, fs)
|
2018-12-31 02:18:41 +01:00
|
|
|
}
|