]> Cypherpunks repositories - gostls13.git/commitdiff
go/build: test code cleanup: remove unnecessary func var
authorHyang-Ah Hana Kim <hyangah@gmail.com>
Tue, 20 Oct 2015 21:42:21 +0000 (17:42 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Wed, 21 Oct 2015 17:57:47 +0000 (17:57 +0000)
The earlier calls to test(false) in TestDependencies were
removed by https://golang.org/cl/12576

Change-Id: If5c7994172379c2d7f633d2e9c5261e668c754fa
Reviewed-on: https://go-review.googlesource.com/16117
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/go/build/deps_test.go

index 58b93436eea9609b5682b6d9a1c32feed5e2a9bc..9746c167ab0bd81ae7ac041a11a59dd8b3a12b49 100644 (file)
@@ -456,26 +456,23 @@ func TestDependencies(t *testing.T) {
        }
        sort.Strings(all)
 
-       test := func(mustImport bool) {
-               for _, pkg := range all {
-                       imports, err := findImports(pkg)
-                       if err != nil {
-                               t.Error(err)
-                               continue
-                       }
-                       ok := allowed(pkg)
-                       var bad []string
-                       for _, imp := range imports {
-                               if !ok[imp] {
-                                       bad = append(bad, imp)
-                               }
-                       }
-                       if bad != nil {
-                               t.Errorf("unexpected dependency: %s imports %v", pkg, bad)
+       for _, pkg := range all {
+               imports, err := findImports(pkg)
+               if err != nil {
+                       t.Error(err)
+                       continue
+               }
+               ok := allowed(pkg)
+               var bad []string
+               for _, imp := range imports {
+                       if !ok[imp] {
+                               bad = append(bad, imp)
                        }
                }
+               if bad != nil {
+                       t.Errorf("unexpected dependency: %s imports %v", pkg, bad)
+               }
        }
-       test(true)
 }
 
 var buildIgnore = []byte("\n// +build ignore")