diff --git a/go/analysis/cmd/vet-lite/main.go b/go/analysis/cmd/vet-lite/main.go index b4b0e631..e847d8df 100644 --- a/go/analysis/cmd/vet-lite/main.go +++ b/go/analysis/cmd/vet-lite/main.go @@ -96,6 +96,7 @@ func main() { for _, name := range []string{"source", "v", "all"} { _ = flag.Bool(name, false, "no effect (deprecated)") } + _ = flag.String("tags", "", "no effect (deprecated)") flag.Usage = func() { fmt.Fprintln(os.Stderr, `Usage of vet: diff --git a/go/analysis/internal/unitchecker/unitchecker.go b/go/analysis/internal/unitchecker/unitchecker.go index 32b50c1b..8ca42ab6 100644 --- a/go/analysis/internal/unitchecker/unitchecker.go +++ b/go/analysis/internal/unitchecker/unitchecker.go @@ -58,7 +58,7 @@ type Config struct { Dir string ImportPath string GoFiles []string - OtherFiles []string // TODO(adonovan): make go vet populate this (github.com/golang/go/issues/27665) + NonGoFiles []string ImportMap map[string]string PackageFile map[string]string Standard map[string]bool @@ -82,7 +82,7 @@ func Main(configFile string, analyzers []*analysis.Analyzer) { log.Fatal(err) } - if len(diags) > 0 { + if !cfg.VetxOnly && len(diags) > 0 { for _, diag := range diags { fmt.Fprintf(os.Stderr, "%s: %s\n", fset.Position(diag.Pos), diag.Message) } @@ -250,7 +250,7 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]an Analyzer: a, Fset: fset, Files: files, - OtherFiles: cfg.OtherFiles, + OtherFiles: cfg.NonGoFiles, Pkg: pkg, TypesInfo: info, ResultOf: inputs,