From 0628711e7bc365b1781041d266897a231cf65c23 Mon Sep 17 00:00:00 2001 From: Cesar Gimenes Date: Tue, 30 Oct 2018 07:06:21 -0300 Subject: [PATCH] remove unnecessary goroutine and with that fix the possible data race condition in tests --- subscription/subscription_test.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/subscription/subscription_test.go b/subscription/subscription_test.go index 9cbc561a..2b99fb76 100644 --- a/subscription/subscription_test.go +++ b/subscription/subscription_test.go @@ -17,12 +17,8 @@ func TestCreateSubscription(t *testing.T) { } func TestSubscription(t *testing.T) { - var first time.Time - go func() { - first = time.Now() - }() - sub := New().Subscribe() + first := sub.SubscribeAt <-time.After(10 * time.Millisecond) sub = sub.Unsubscribe()