code: func (r *Random) Select(pool HostPool) *UpstreamHost {
  	// instead of just generating a random index
  	// this is done to prevent selecting a down host
  	var randHost *UpstreamHost
  	count := 0
  	for _, host := range pool {
  		if host.Down() {
  			continue
  		}
  		count++
  		if count == 1 {
  			randHost = host
  		} else {
  			r := rand.Int() % count
  			if r == (count - 1) {
  				randHost = host
  			}
  		}
  	}
  	return randHost
  }
docs: // Select selects an up host at random from the specified pool.