forked from Ivasoft/traefik
test: HealthCheck review.
This commit is contained in:
committed by
Ludovic Fernandez
parent
a1a0420314
commit
2d1ddcf28b
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
// Intp returns a pointer to the given integer value.
|
||||
@@ -19,3 +20,12 @@ func MustNewRequest(method, urlStr string, body io.Reader) *http.Request {
|
||||
}
|
||||
return request
|
||||
}
|
||||
|
||||
// MustParseURL parses a URL or panics if it can't
|
||||
func MustParseURL(rawURL string) *url.URL {
|
||||
u, err := url.Parse(rawURL)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("failed to parse URL '%s': %s", rawURL, err))
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user