mirror of
https://github.com/golang/go
synced 2024-09-30 20:18:33 -06:00
go/build: test code cleanup: remove unnecessary func var
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>
This commit is contained in:
parent
08d04ba2a4
commit
163653eeaa
@ -456,26 +456,23 @@ func TestDependencies(t *testing.T) {
|
|||||||
}
|
}
|
||||||
sort.Strings(all)
|
sort.Strings(all)
|
||||||
|
|
||||||
test := func(mustImport bool) {
|
for _, pkg := range all {
|
||||||
for _, pkg := range all {
|
imports, err := findImports(pkg)
|
||||||
imports, err := findImports(pkg)
|
if err != nil {
|
||||||
if err != nil {
|
t.Error(err)
|
||||||
t.Error(err)
|
continue
|
||||||
continue
|
}
|
||||||
}
|
ok := allowed(pkg)
|
||||||
ok := allowed(pkg)
|
var bad []string
|
||||||
var bad []string
|
for _, imp := range imports {
|
||||||
for _, imp := range imports {
|
if !ok[imp] {
|
||||||
if !ok[imp] {
|
bad = append(bad, imp)
|
||||||
bad = append(bad, imp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if bad != nil {
|
|
||||||
t.Errorf("unexpected dependency: %s imports %v", pkg, bad)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if bad != nil {
|
||||||
|
t.Errorf("unexpected dependency: %s imports %v", pkg, bad)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
test(true)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var buildIgnore = []byte("\n// +build ignore")
|
var buildIgnore = []byte("\n// +build ignore")
|
||||||
|
Loading…
Reference in New Issue
Block a user