]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: fix selection of packages for testing
authorDmitriy Vyukov <dvyukov@google.com>
Fri, 9 Nov 2012 10:00:41 +0000 (14:00 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Fri, 9 Nov 2012 10:00:41 +0000 (14:00 +0400)
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

src/cmd/go/main.go

index 840d584cd02254147bc5962d9a92020c92e06ebf..d66be9a2728772c9143dda5161045182ee912e1b 100644 (file)
@@ -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
                        }