]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/go/build/build.go
[dev.boringcrypto] all: merge master into dev.boringcrypto
[gostls13.git] / src / go / build / build.go
index b0decbba9f514db3fea79803040f7fba7f5bd4d7..4bf46a8970be3a882096aa93e0c5a9a9138730a5 100644 (file)
@@ -789,7 +789,7 @@ Found:
                }
 
                // package was not found
-               return p, fmt.Errorf("cannot find package %q in:\n\t%s", path, p.Dir)
+               return p, fmt.Errorf("cannot find package %q in:\n\t%s", p.ImportPath, p.Dir)
        }
 
        if mode&FindOnly != 0 {
@@ -894,7 +894,7 @@ Found:
 
                isTest := strings.HasSuffix(name, "_test.go")
                isXTest := false
-               if isTest && strings.HasSuffix(pkg, "_test") {
+               if isTest && strings.HasSuffix(pkg, "_test") && p.Name != pkg {
                        isXTest = true
                        pkg = pkg[:len(pkg)-len("_test")]
                }