code: func (b *Buffer) subscribe(msgc chan<- *rfc5424.Message, donec <-chan struct{}) {
  	b.subs[msgc] = struct{}{}
  
  	go func() {
  		select {
  		case <-donec:
  		case <-b.donec:
  		}
  
  		b.mu.Lock()
  		defer b.mu.Unlock()
  
  		delete(b.subs, msgc)
  		close(msgc)
  	}()
  }
docs: // _subscribe assumes b.mu is already locked