func HealthCheck(endpoint string, timeout time.Duration) error {
	url, err := url.Parse(endpoint)
	if err != nil {
		return err
	}

	switch url.Scheme {
	case "tcp":
		var conn net.Conn
		if conn, err = net.DialTimeout(url.Scheme, url.Host, timeout); err != nil {
			return err
		}
		conn.Close()
	case "http", "https":
		client := &http.Client{
			Timeout: timeout,
		}
		var resp *http.Response
		resp, err = client.Get(endpoint)

		switch {
		case err != nil:
			return err
		case resp.StatusCode >= 200 && resp.StatusCode <= 299:
			return nil
		default:
			return fmt.Errorf("error: HTTP %d", resp.StatusCode)
		}
	default:
		return fmt.Errorf("error: Unsupported URL scheme: %s", url.Scheme)
	}
	return nil
}
// HealthCheck function TODO (llparse): inherit this function from giddyup
HealthCheck function TODO (llparse): inherit this function from giddyup
// HealthCheck function TODO ( llparse ) : inherit this function from giddyup
func HealthCheck(endpoint string, timeout time.Duration) error {
	url, err := url.Parse(endpoint)
	if err != nil {
		return err
	}
	switch url.Scheme {
	case "tcp":
		var conn net.Conn
		if conn, err = net.DialTimeout(url.Scheme, url.Host, timeout); err != nil {
			return err
		}
		conn.Close()
	case "http", "https":
		client := &http.Client{
			Timeout: timeout,
		}
		var resp *http.Response
		resp, err = client.Get(endpoint)
		switch {
		case err != nil:
			return err
		case resp.StatusCode >= 200 && resp.StatusCode <= 299:
			return nil
		default:
			return fmt.Errorf("error: HTTP %d", resp.StatusCode)
		}
	default:
		return fmt.Errorf("error: Unsupported URL scheme: %s", url.Scheme)
	}
	return nil
}
func HealthCheck ( endpoint string , timeout time . Duration ) error { url , err := url . Parse ( endpoint ) if err != nil { return err } switch url . Scheme { case " " : var conn net . Conn if conn , err = net . DialTimeout ( url . Scheme , url . Host , timeout ) ; err != nil { return err } conn . Close ( ) case " " , " " : client := & http . Client { Timeout : timeout , } var resp * http . Response resp , err = client . Get ( endpoint ) switch { case err != nil : return err case resp . StatusCode >= 200 && resp . StatusCode <= 299 : return nil default : return fmt . Errorf ( " " , resp . StatusCode ) } default : return fmt . Errorf ( " " , url . Scheme ) } return nil }
HealthCheck function TODO (llparse): inherit this function from giddyup
HealthCheck function TODO ( llparse ) : inherit this function from giddyup