net: simplify sync.Once calls in tests

Change-Id: I0c2e1a4a8261887a696e585dda46e72d691191e0
Reviewed-on: https://go-review.googlesource.com/10070
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Mikio Hara 2015-05-14 09:25:24 +09:00
parent e5febf957f
commit ef54930ebb
6 changed files with 16 additions and 16 deletions

View file

@ -227,7 +227,7 @@ func TestReloadResolvConfChange(t *testing.T) {
}
func BenchmarkGoLookupIP(b *testing.B) {
testHookUninstaller.Do(func() { uninstallTestHooks() })
testHookUninstaller.Do(uninstallTestHooks)
for i := 0; i < b.N; i++ {
goLookupIP("www.example.com")
@ -235,7 +235,7 @@ func BenchmarkGoLookupIP(b *testing.B) {
}
func BenchmarkGoLookupIPNoSuchHost(b *testing.B) {
testHookUninstaller.Do(func() { uninstallTestHooks() })
testHookUninstaller.Do(uninstallTestHooks)
for i := 0; i < b.N; i++ {
goLookupIP("some.nonexistent")
@ -243,7 +243,7 @@ func BenchmarkGoLookupIPNoSuchHost(b *testing.B) {
}
func BenchmarkGoLookupIPWithBrokenNameServer(b *testing.B) {
testHookUninstaller.Do(func() { uninstallTestHooks() })
testHookUninstaller.Do(uninstallTestHooks)
onceLoadConfig.Do(loadDefaultConfig)