mirror of
				https://github.com/taigrr/go-fastping
				synced 2025-01-18 05:03:15 -08:00 
			
		
		
		
	Use defer when it calls Mutex Unlock
This commit is contained in:
		
							parent
							
								
									7224648946
								
							
						
					
					
						commit
						4b49bd943e
					
				@ -152,13 +152,13 @@ func TestMultiRun(t *testing.T) {
 | 
				
			|||||||
		break
 | 
							break
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	mu.Lock()
 | 
						mu.Lock()
 | 
				
			||||||
 | 
						defer mu.Unlock()
 | 
				
			||||||
	if res1 != 1 {
 | 
						if res1 != 1 {
 | 
				
			||||||
		t.Fatalf("Pinger 1 didn't get correct response")
 | 
							t.Fatalf("Pinger 1 didn't get correct response")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if res2 != 1 {
 | 
						if res2 != 1 {
 | 
				
			||||||
		t.Fatalf("Pinger 2 didn't get correct response")
 | 
							t.Fatalf("Pinger 2 didn't get correct response")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	mu.Unlock()
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func TestRunLoop(t *testing.T) {
 | 
					func TestRunLoop(t *testing.T) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user