Skip to content

Commit

Permalink
go/build: test code cleanup: remove unnecessary func var
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hyangah committed Oct 21, 2015
1 parent 08d04ba commit 163653e
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/go/build/deps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 163653e

Please sign in to comment.