From c10ce5142a67d51117284845985c1427f6dbdc26 Mon Sep 17 00:00:00 2001 From: Tom Thorogood Date: Thu, 4 Oct 2018 15:54:09 +0930 Subject: [PATCH] Fix race on loop variable in TestConcurrentExchanges (#773) --- client_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client_test.go b/client_test.go index 43163a1f..63a90afd 100644 --- a/client_test.go +++ b/client_test.go @@ -539,8 +539,9 @@ func TestConcurrentExchanges(t *testing.T) { block := make(chan struct{}) waiting := make(chan struct{}) + mm := m // redeclare m so as not to trip the race detector handler := func(w ResponseWriter, req *Msg) { - r := m.Copy() + r := mm.Copy() r.SetReply(req) waiting <- struct{}{}