1 // staticcheck analyses Go code and makes it better.
2 package main // import "honnef.co/go/tools/cmd/staticcheck"
8 "golang.org/x/tools/go/analysis"
9 "honnef.co/go/tools/lint"
10 "honnef.co/go/tools/lint/lintutil"
11 "honnef.co/go/tools/simple"
12 "honnef.co/go/tools/staticcheck"
13 "honnef.co/go/tools/stylecheck"
14 "honnef.co/go/tools/unused"
18 fs := lintutil.FlagSet("staticcheck")
19 wholeProgram := fs.Bool("unused.whole-program", false, "Run unused in whole program mode")
20 debug := fs.String("debug.unused-graph", "", "Write unused's object graph to `file`")
23 var cs []*analysis.Analyzer
24 for _, v := range simple.Analyzers {
27 for _, v := range staticcheck.Analyzers {
30 for _, v := range stylecheck.Analyzers {
34 u := unused.NewChecker(*wholeProgram)
36 f, err := os.OpenFile(*debug, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
42 cums := []lint.CumulativeChecker{u}
43 lintutil.ProcessFlagSet(cs, cums, fs)