1
0
mirror of https://github.com/tmrts/go-patterns.git synced 2024-11-24 05:56:08 +03:00

messaging/publish-subscribe: fix channel read

This commit is contained in:
Tamer Tas 2016-09-20 22:17:06 +03:00 committed by GitHub
parent d717978979
commit 82fc76d6ab

View File

@ -27,7 +27,7 @@ type Subscription struct {
}
func (s *Subscription) Publish(msg Message) error {
if _, ok := s.ch; !ok {
if _, ok := <-s.ch; !ok {
return errors.New("Topic has been closed")
}