diff --git a/messaging/publish_subscribe.md b/messaging/publish_subscribe.md index 79d4405..638363e 100644 --- a/messaging/publish_subscribe.md +++ b/messaging/publish_subscribe.md @@ -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") }