diff --git a/gossip.go b/gossip.go index b67ac35..3c95bd0 100644 --- a/gossip.go +++ b/gossip.go @@ -226,11 +226,11 @@ func (d *delegate) MergeRemoteState(buf []byte, join bool) { func (m *gossipRegistry) publish(action string, services []*registry.Service) { m.s.RLock() for _, sub := range m.subs { - go func() { + go func(sub chan *registry.Result) { for _, service := range services { sub <- ®istry.Result{Action: action, Service: service} } - }() + }(sub) } m.s.RUnlock() }