aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vet/main.go
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2018-11-12 13:42:46 -0500
committerAlan Donovan <adonovan@google.com>2018-11-13 16:10:01 +0000
commite787b133284263e53154b8b2f8f6078e8f0c9850 (patch)
tree56d74b42fbf952ca24fa4d0aaf5c2d8b740d8e79 /src/cmd/vet/main.go
parentb075dfba8066033e35cd62aaacf3c8a2593cfa57 (diff)
downloadgo-e787b133284263e53154b8b2f8f6078e8f0c9850.tar.gz
go-e787b133284263e53154b8b2f8f6078e8f0c9850.zip
cmd/go: vet: pass non-.go files to vet tool
The "gofiles" cache entry has been renamed "srcfiles", and it includes non-Go files (.s, .c, .cxx) that belong to the package. It does not include raw cgo files. Added regression test. Fixes #27665 Change-Id: I4884fe9b4f823f50705f8c2d357a04a8e567734f Reviewed-on: https://go-review.googlesource.com/c/148904 Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/vet/main.go')
-rw-r--r--src/cmd/vet/main.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go
index cf91e4d596..799f0bfb64 100644
--- a/src/cmd/vet/main.go
+++ b/src/cmd/vet/main.go
@@ -365,6 +365,7 @@ type vetConfig struct {
Dir string
ImportPath string
GoFiles []string
+ NonGoFiles []string
ImportMap map[string]string
PackageFile map[string]string
Standard map[string]bool
@@ -430,7 +431,12 @@ func doPackageCfg(cfgFile string) {
stdImporter = &vcfg
inittypes()
mustTypecheck = true
- doPackage(vcfg.GoFiles, nil)
+
+ var allFiles []string
+ allFiles = append(allFiles, vcfg.GoFiles...)
+ allFiles = append(allFiles, vcfg.NonGoFiles...)
+
+ doPackage(allFiles, nil)
if vcfg.VetxOutput != "" {
out := make([]vetxExport, 0, len(exporters))
for name, fn := range exporters {