mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-11-11 23:07:51 +03:00
messaging/publish-subscribe: fix channel read
This commit is contained in:
1 parent
d717978979
commit
82fc76d6ab
1 file changed
+1
-1
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user