Fix NewClientWithHTTP (#192)

This commit is contained in:
Lunny Xiao 2019-10-30 14:43:01 +00:00
parent e41e9ea72c
commit 2a5a0e75e5

View file

@ -39,9 +39,10 @@ func NewClient(url, token string) *Client {
}
// NewClientWithHTTP creates an API client with a custom http client
func NewClientWithHTTP(url string, httpClient *http.Client) {
func NewClientWithHTTP(url string, httpClient *http.Client) *Client {
client := NewClient(url, "")
client.client = httpClient
return client
}
// SetHTTPClient replaces default http.Client with user given one.