Update module spf13/viper to v1.7.0 (#494)
Update module spf13/viper to v1.7.0 Reviewed-on: https://kolaente.dev/vikunja/api/pulls/494
This commit is contained in:
@ -2,8 +2,10 @@
|
||||
package main // import "honnef.co/go/tools/cmd/staticcheck"
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"golang.org/x/tools/go/analysis"
|
||||
"honnef.co/go/tools/lint"
|
||||
"honnef.co/go/tools/lint/lintutil"
|
||||
"honnef.co/go/tools/simple"
|
||||
@ -14,14 +16,29 @@ import (
|
||||
|
||||
func main() {
|
||||
fs := lintutil.FlagSet("staticcheck")
|
||||
wholeProgram := fs.Bool("unused.whole-program", false, "Run unused in whole program mode")
|
||||
debug := fs.String("debug.unused-graph", "", "Write unused's object graph to `file`")
|
||||
fs.Parse(os.Args[1:])
|
||||
|
||||
checkers := []lint.Checker{
|
||||
simple.NewChecker(),
|
||||
staticcheck.NewChecker(),
|
||||
stylecheck.NewChecker(),
|
||||
&unused.Checker{},
|
||||
var cs []*analysis.Analyzer
|
||||
for _, v := range simple.Analyzers {
|
||||
cs = append(cs, v)
|
||||
}
|
||||
for _, v := range staticcheck.Analyzers {
|
||||
cs = append(cs, v)
|
||||
}
|
||||
for _, v := range stylecheck.Analyzers {
|
||||
cs = append(cs, v)
|
||||
}
|
||||
|
||||
lintutil.ProcessFlagSet(checkers, fs)
|
||||
u := unused.NewChecker(*wholeProgram)
|
||||
if *debug != "" {
|
||||
f, err := os.OpenFile(*debug, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
u.Debug = f
|
||||
}
|
||||
cums := []lint.CumulativeChecker{u}
|
||||
lintutil.ProcessFlagSet(cs, cums, fs)
|
||||
}
|
||||
|
Reference in New Issue
Block a user