Commit b8b6e4b8 authored by Sander van Harmelen's avatar Sander van Harmelen

Return a pointer instead

This way you can keep using the pointer methods on *url.URL as expected.
parent 2ab1a4eb
...@@ -149,8 +149,9 @@ func NewClient(httpClient *http.Client, token string) *Client { ...@@ -149,8 +149,9 @@ func NewClient(httpClient *http.Client, token string) *Client {
} }
// BaseURL return a copy of the baseURL. // BaseURL return a copy of the baseURL.
func (c *Client) BaseURL() url.URL { func (c *Client) BaseURL() *url.URL {
return *c.baseURL u := *c.baseURL
return &u
} }
// SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr // SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment