hub.go
func (hub *hub) Subscribe(channels []string) (Channel, error) {
	var chans []*channel
	for _, name := range channels {
		chans = append(chans, hub.getChannel(name))
	}
	var sub = makeSub(chans)
	for _, cn := range chans {
		cn.Subscribe(sub)
	}
	return sub, nil
}
func (hub *hub) Subscribe(channels []string) (Channel, error) {
	var chans []*channel
	for _, name := range channels {
		chans = append(chans, hub.getChannel(name))
	}
	var sub = makeSub(chans)
	for _, cn := range chans {
		cn.Subscribe(sub)
	}
	return sub, nil
}
func ( hub * hub ) Subscribe ( channels [ ] string ) ( Channel , error ) { var chans [ ] * channel for _ , name := range channels { chans = append ( chans , hub . getChannel ( name ) ) } var sub = makeSub ( chans ) for _ , cn := range chans { cn . Subscribe ( sub ) } return sub , nil }
// Subscribe adds new receiver of events for given channel.
Subscribe adds new receiver of events for given channel .