go/types: prevent panic with multi-tag, multi-file test packages

notag.go
```
package repro
```

tag.go
```
//go:build ignore

package repro
```

Change-Id: I6eb2f61f3434ac575e9081747c8da8aab24f4823
Reviewed-on: https://go-review.googlesource.com/c/go/+/772800
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Neal Patel <nealpatel@google.com>
This commit is contained in:
Neal Patel 2026-04-30 19:30:21 -04:00 committed by Gopher Robot
parent f230dd8a1d
commit f03f2ab67a

View file

@ -480,7 +480,7 @@ func testPkg(t *testing.T, filenames []string, manual bool) {
if len(fs) == 0 {
t.Skip("all files skipped by build tags")
}
testFiles(t, filenames, srcs, manual)
testFiles(t, fs, srcs, manual)
}
// shouldTest checks build tags in src and returns whether the file