code: func (u *HealthCheck) Select() *UpstreamHost {
  	pool := u.Hosts
  	if len(pool) == 1 {
  		if pool[0].Down() && u.Spray == nil {
  			return nil
  		}
  		return pool[0]
  	}
  	allDown := true
  	for _, host := range pool {
  		if !host.Down() {
  			allDown = false
  			break
  		}
  	}
  	if allDown {
  		if u.Spray == nil {
  			return nil
  		}
  		return u.Spray.Select(pool)
  	}
  
  	if u.Policy == nil {
  		h := (&Random{}).Select(pool)
  		if h != nil {
  			return h
  		}
  		if h == nil && u.Spray == nil {
  			return nil
  		}
  		return u.Spray.Select(pool)
  	}
  
  	h := u.Policy.Select(pool)
  	if h != nil {
  		return h
  	}
  
  	if u.Spray == nil {
  		return nil
  	}
  	return u.Spray.Select(pool)
  }
docs: // Select selects an upstream host based on the policy
  // and the healthcheck result.