func (e *Events) Subscribe() ([]*jsonmessage.JSONMessage, chan interface{}) {
	e.mu.Lock()
	current := make([]*jsonmessage.JSONMessage, len(e.events))
	copy(current, e.events)
	l := e.pub.Subscribe()
	e.mu.Unlock()
	return current, l
}
// Subscribe adds new listener to events, returns slice of 64 stored last events
// channel in which you can expect new events in form of interface{}, so you
// need type assertion.
Subscribe adds new listener to events, returns slice of 64 stored last events
channel in which you can expect new events in form of interface{}, so you
need type assertion.
// Subscribe adds new listener to events returns slice of 64 stored last events // channel in which you can expect new events in form of interface {} so you // need type assertion .
func (e *Events) Subscribe() ([]*jsonmessage.JSONMessage, chan interface{}) {
	e.mu.Lock()
	current := make([]*jsonmessage.JSONMessage, len(e.events))
	copy(current, e.events)
	l := e.pub.Subscribe()
	e.mu.Unlock()
	return current, l
}
func ( e * Events ) Subscribe ( ) ( [ ] * jsonmessage . JSONMessage , chan interface { } ) { e . mu . Lock ( ) current := make ( [ ] * jsonmessage . JSONMessage , len ( e . events ) ) copy ( current , e . events ) l := e . pub . Subscribe ( ) e . mu . Unlock ( ) return current , l }
Subscribe adds new listener to events, returns slice of 64 stored last events
channel in which you can expect new events in form of interface{}, so you
need type assertion.
Subscribe adds new listener to events returns slice of 64 stored last events channel in which you can expect new events in form of interface {} so you need type assertion .