tg.run("list", "./testdata/testinternal3")
}
+func TestInternalCache(t *testing.T) {
+ tg := testgo(t)
+ defer tg.cleanup()
+ tg.setenv("GOPATH", filepath.Join(tg.pwd(), "testdata/testinternal4"))
+ tg.runFail("build", "p")
+ tg.grepStderr("internal", "did not fail to build p")
+}
+
func TestMoveGit(t *testing.T) {
testMove(t, "git", "rsc.io/pdf", "pdf", "rsc.io/pdf/.git/config")
}
deps[path] = p1
imports = append(imports, p1)
for _, dep := range p1.deps {
- deps[dep.ImportPath] = dep
+ // Do not overwrite entries installed by direct import
+ // just above this loop. Those have stricter constraints
+ // about internal and vendor visibility and may contain
+ // errors that we need to preserve.
+ if deps[dep.ImportPath] == nil {
+ deps[dep.ImportPath] = dep
+ }
}
if p1.Incomplete {
p.Incomplete = true