diff --git a/pubsub/publisher.go b/pubsub/publisher.go index 9d2ae42..0936461 100644 --- a/pubsub/publisher.go +++ b/pubsub/publisher.go @@ -56,10 +56,8 @@ func (p *Publisher) SubscribeTopic(topic topicFunc) chan interface{} { // Evict removes the specified subscriber from receiving any more messages. func (p *Publisher) Evict(sub chan interface{}) { p.m.Lock() - if _, ok := p.subscribers[sub]; ok { - delete(p.subscribers, sub) - close(sub) - } + delete(p.subscribers, sub) + close(sub) p.m.Unlock() }