code: func (b *Broadcaster) Close() error {
  	logrus.Infof("broadcaster: closing")
  	select {
  	case <-b.closed:
  		// already closed
  		return fmt.Errorf("broadcaster: already closed")
  	default:
  		// do a little chan handoff dance to synchronize closing
  		closed := make(chan struct{})
  		b.closed <- closed
  		close(b.closed)
  		<-closed
  		return nil
  	}
  }
docs: // Close the broadcaster, ensuring that all messages are flushed to the
  // underlying sink before returning.