code: func wrapStreamStatusRPC(responses chan common.Status, errs chan error) (*common.Status, error) {
  	var status common.Status
  	var err multi.Errors
  
  read:
  	for {
  		select {
  		case s, ok := <-responses:
  			if !ok {
  				break read
  			}
  			status = s
  		case e := <-errs:
  			err = append(err, e)
  		}
  	}
  
  	// drain remaining errors.
  	for i := 0; i < len(errs); i++ {
  		e := <-errs
  		err = append(err, e)
  	}
  
  	return &status, err.ToError()
  }
docs: // wrapStreamStatusRPC returns the last response and err and blocks until the chan is closed.