mirror of
https://github.com/golang/go
synced 2024-11-20 04:04:41 -07:00
cmd/go: fix selection of packages for testing
Currently it works incorrectly if user specifies own build tags and with race detection (e.g. runtime/race is not selected, because it contains only test files with +build race). R=golang-dev, r CC=golang-dev https://golang.org/cl/6814107
This commit is contained in:
parent
5e57954f8c
commit
4ef91fc854
@ -430,7 +430,7 @@ func matchPackages(pattern string) []string {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
|
||||
_, err = build.ImportDir(path, 0)
|
||||
_, err = buildContext.ImportDir(path, 0)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
@ -471,7 +471,7 @@ func matchPackages(pattern string) []string {
|
||||
}
|
||||
have[name] = true
|
||||
|
||||
_, err = build.ImportDir(path, 0)
|
||||
_, err = buildContext.ImportDir(path, 0)
|
||||
if err != nil && strings.Contains(err.Error(), "no Go source files") {
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user