mirror of
				https://github.com/golang/go.git
				synced 2025-10-31 08:40:55 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									e5febf957f
								
							
						
					
					
						commit
						ef54930ebb
					
				
					 6 changed files with 16 additions and 16 deletions
				
			
		|  | @ -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) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Mikio Hara
						Mikio Hara