diff options
Diffstat (limited to 'src/go/build/deps_test.go')
-rw-r--r-- | src/go/build/deps_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go index c7e22463f9..e5f343a185 100644 --- a/src/go/build/deps_test.go +++ b/src/go/build/deps_test.go @@ -597,11 +597,10 @@ func TestDependencies(t *testing.T) { if sawImport[pkg] == nil { sawImport[pkg] = map[string]bool{} } - ok := policy[pkg] var bad []string for _, imp := range imports { sawImport[pkg][imp] = true - if !ok[imp] { + if !policy.HasEdge(pkg, imp) { bad = append(bad, imp) } } @@ -670,7 +669,7 @@ func findImports(pkg string) ([]string, error) { } // depsPolicy returns a map m such that m[p][d] == true when p can import d. -func depsPolicy(t *testing.T) map[string]map[string]bool { +func depsPolicy(t *testing.T) *dag.Graph { g, err := dag.Parse(depsRules) if err != nil { t.Fatal(err) |