// If we are going to do a full build anyway,
// we're going to regenerate the files in the build action anyway.
if need == needVet {
- if err := b.loadCachedVet(buildAction); err == nil {
+ if err := b.loadCachedVet(buildAction, a.Deps); err == nil {
need &^= needVet
}
}
// Prepare Go vet config if needed.
if need&needVet != 0 {
- buildVetConfig(a, srcfiles)
+ buildVetConfig(a, srcfiles, a.Deps)
need &^= needVet
}
if need&needCompiledGoFiles != 0 {
cache.PutBytes(c, cache.Subkey(a.actionID, "srcfiles"), buf.Bytes())
}
-func (b *Builder) loadCachedVet(a *Action) error {
+func (b *Builder) loadCachedVet(a *Action, vetDeps []*Action) error {
c := cache.Default()
list, _, err := cache.GetBytes(c, cache.Subkey(a.actionID, "srcfiles"))
if err != nil {
}
srcfiles = append(srcfiles, a.Objdir+name)
}
- buildVetConfig(a, srcfiles)
+ buildVetConfig(a, srcfiles, vetDeps)
return nil
}
SucceedOnTypecheckFailure bool // awful hack; see #18395 and below
}
-func buildVetConfig(a *Action, srcfiles []string) {
+func buildVetConfig(a *Action, srcfiles []string, vetDeps []*Action) {
// Classify files based on .go extension.
// srcfiles does not include raw cgo files.
var gofiles, nongofiles []string
vcfgMapped[p] = true
}
- for _, a1 := range a.Deps {
+ for _, a1 := range vetDeps {
p1 := a1.Package
if p1 == nil || p1.ImportPath == "" || p1 == a.Package {
continue