code: func (r *LeastConn) Select(pool HostPool) *UpstreamHost {
  	var bestHost *UpstreamHost
  	count := 0
  	leastConn := int64(1<<63 - 1)
  	for _, host := range pool {
  		if host.Down() {
  			continue
  		}
  		hostConns := host.Conns
  		if hostConns < leastConn {
  			bestHost = host
  			leastConn = hostConns
  			count = 1
  		} else if hostConns == leastConn {
  			// randomly select host among hosts with least connections
  			count++
  			if count == 1 {
  				bestHost = host
  			} else {
  				r := rand.Int() % count
  				if r == (count - 1) {
  					bestHost = host
  				}
  			}
  		}
  	}
  	return bestHost
  }
docs: // Select selects the up host with the least number of connections in the
  // pool.  If more than one host has the same least number of connections,
  // one of the hosts is chosen at random.