Merge pull request #17 from derekperkins/patch-1

fix goroutine race condition
This commit is contained in:
Derrick J. Wippler 2020-07-08 11:42:48 -05:00 committed by GitHub
commit 7dd8e405d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,10 +265,10 @@ func (g *Group) Remove(ctx context.Context, key string) error {
}
wg.Add(1)
go func() {
go func(peer ProtoGetter) {
errs <- g.removeFromPeer(ctx, peer, key)
wg.Done()
}()
}(peer)
}
go func() {
wg.Wait()