func (p *JSONMessagePublisher) Unsubscribe(l JSONMessageListener) bool {
	p.m.Lock()
	defer p.m.Unlock()

	for i, subscriber := range p.subscribers {
		if subscriber == l {
			close(l)
			p.subscribers = append(p.subscribers[:i], p.subscribers[i+1:]...)
			return true
		}
	}
	return false
}
// Unsubscribe closes and removes the specified listener from the list of
// previously registed ones.
// It returns a boolean value indicating if the listener was successfully
// found, closed and unregistered.
Unsubscribe closes and removes the specified listener from the list of
previously registed ones.
It returns a boolean value indicating if the listener was successfully
found, closed and unregistered.
// Unsubscribe closes and removes the specified listener from the list of // previously registed ones . // It returns a boolean value indicating if the listener was successfully // found closed and unregistered .
func (p *JSONMessagePublisher) Unsubscribe(l JSONMessageListener) bool {
	p.m.Lock()
	defer p.m.Unlock()
	for i, subscriber := range p.subscribers {
		if subscriber == l {
			close(l)
			p.subscribers = append(p.subscribers[:i], p.subscribers[i+1:]...)
			return true
		}
	}
	return false
}
func ( p * JSONMessagePublisher ) Unsubscribe ( l JSONMessageListener ) bool { p . m . Lock ( ) defer p . m . Unlock ( ) for i , subscriber := range p . subscribers { if subscriber == l { close ( l ) p . subscribers = append ( p . subscribers [ : i ] , p . subscribers [ i + 1 : ] ... ) return true } } return false }
Unsubscribe closes and removes the specified listener from the list of
previously registed ones.
Unsubscribe closes and removes the specified listener from the list of previously registed ones .