From 33cd97fb23190da6feeaae498446e376d0e73438 Mon Sep 17 00:00:00 2001 From: Chun Chen Date: Fri, 12 Jun 2015 15:42:34 +0800 Subject: [PATCH] Fix send on closed channel bug Signed-off-by: Chun Chen --- pubsub/publisher.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pubsub/publisher.go b/pubsub/publisher.go index f017262..534b74a 100644 --- a/pubsub/publisher.go +++ b/pubsub/publisher.go @@ -68,6 +68,7 @@ func (p *Publisher) Publish(v interface{}) { func (p *Publisher) Close() { p.m.Lock() for sub := range p.subscribers { + delete(p.subscribers, sub) close(sub) } p.m.Unlock()