http.go
func setURL(client *Client, route string, query url.Values) (u *url.URL, err error) {
	URL := client.BaseURL
	// See https://bugzil.la/1484702
	// Avoid double separator; routes must start with `/`, so baseURL shouldn't
	// end with `/`.
	if strings.HasSuffix(URL, "/") {
		URL = URL[:len(URL)-1]
	}
	URL += route
	u, err = url.Parse(URL)
	if err != nil {
		return nil, fmt.Errorf("Cannot parse url: '%v', is BaseURL (%v) set correctly?\n%v\n", URL, client.BaseURL, err)
	}
	if query != nil {
		u.RawQuery = query.Encode()
	}
	return
}
func setURL(client *Client, route string, query url.Values) (u *url.URL, err error) {
	URL := client.BaseURL
	// See https://bugzil.la/1484702
	// Avoid double separator; routes must start with `/`, so baseURL shouldn't
	// end with `/`.
	if strings.HasSuffix(URL, "/") {
		URL = URL[:len(URL)-1]
	}
	URL += route
	u, err = url.Parse(URL)
	if err != nil {
		return nil, fmt.Errorf("Cannot parse url: '%v', is BaseURL (%v) set correctly?\n%v\n", URL, client.BaseURL, err)
	}
	if query != nil {
		u.RawQuery = query.Encode()
	}
	return
}
// utility function to create a URL object based on given data