diff --git a/src/cmd/internal/moddeps/moddeps_test.go b/src/cmd/internal/moddeps/moddeps_test.go index 5d73edd318..2e6167322e 100644 --- a/src/cmd/internal/moddeps/moddeps_test.go +++ b/src/cmd/internal/moddeps/moddeps_test.go @@ -36,7 +36,7 @@ func findGorootModules(t *testing.T) []gorootModule { if err != nil { return err } - if info.Name() == "vendor" || info.Name() == "testdata" { + if info.IsDir() && (info.Name() == "vendor" || info.Name() == "testdata") { return filepath.SkipDir } if path == filepath.Join(runtime.GOROOT(), "pkg") {