1
0
mirror of https://github.com/tmrts/go-patterns.git synced 2024-11-22 04:56:09 +03:00

Nothing special on Subscription (#5)

This commit is contained in:
Gerasimos Maropoulos 2016-09-05 17:34:47 +03:00 committed by Tamer Tas
parent 3d2d78a8a2
commit 3da8fc4d4f

View File

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