author | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-10-08 11:17:16 UTC |
committer | Alberto Bertogli
<albertito@blitiri.com.ar> 2016-10-09 23:51:05 UTC |
parent | 08a5d19941f0329d02b1a350cd3652ed3ddd6c30 |
internal/queue/queue_test.go | +3 | -0 |
diff --git a/internal/queue/queue_test.go b/internal/queue/queue_test.go index 11d6ed5..b77ebe1 100644 --- a/internal/queue/queue_test.go +++ b/internal/queue/queue_test.go @@ -41,13 +41,16 @@ type TestCourier struct { wg sync.WaitGroup requests []*deliverRequest reqFor map[string]*deliverRequest + sync.Mutex } func (tc *TestCourier) Deliver(from string, to string, data []byte) (error, bool) { defer tc.wg.Done() dr := &deliverRequest{from, to, data} + tc.Lock() tc.requests = append(tc.requests, dr) tc.reqFor[to] = dr + tc.Unlock() return nil, false }