1
0
Fork 0

test: HealthCheck review.

This commit is contained in:
Fernandez Ludovic 2017-06-03 15:02:28 +02:00 committed by Ludovic Fernandez
parent a1a0420314
commit 2d1ddcf28b
2 changed files with 82 additions and 81 deletions

View file

@ -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
}