From 4b49bd943e749e1f6fa68c12fc1f6fbd326b1250 Mon Sep 17 00:00:00 2001 From: Tatsushi Demachi Date: Mon, 21 Apr 2014 22:50:00 +0900 Subject: [PATCH] Use defer when it calls Mutex Unlock --- fastping_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastping_test.go b/fastping_test.go index 12d17ce..52e58d5 100644 --- a/fastping_test.go +++ b/fastping_test.go @@ -152,13 +152,13 @@ func TestMultiRun(t *testing.T) { break } mu.Lock() + defer mu.Unlock() if res1 != 1 { t.Fatalf("Pinger 1 didn't get correct response") } if res2 != 1 { t.Fatalf("Pinger 2 didn't get correct response") } - mu.Unlock() } func TestRunLoop(t *testing.T) {