1 // staticcheck analyses Go code and makes it better.
8 "golang.org/x/tools/go/analysis"
9 "honnef.co/go/tools/lintcmd"
10 "honnef.co/go/tools/simple"
11 "honnef.co/go/tools/staticcheck"
12 "honnef.co/go/tools/stylecheck"
13 "honnef.co/go/tools/unused"
17 fs := lintcmd.FlagSet("staticcheck")
18 debug := fs.String("debug.unused-graph", "", "Write unused's object graph to `file`")
21 var cs []*analysis.Analyzer
22 for _, v := range simple.Analyzers {
25 for _, v := range staticcheck.Analyzers {
28 for _, v := range stylecheck.Analyzers {
32 cs = append(cs, unused.Analyzer)
34 f, err := os.OpenFile(*debug, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
41 lintcmd.ProcessFlagSet(cs, fs)