test: HealthCheck review.
This commit is contained in:
parent
a1a0420314
commit
2d1ddcf28b
2 changed files with 82 additions and 81 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue