-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose http.Client #28
Comments
I think this could be a valuable addition, especially since you could swap out the http client to a mock client for testing purposes. My only piece of feedback is to "constant-ize" the newly instantiated var DefaultHTTPClient = &http.Client{}
//...
func (g *GoogleGeocoder) Request(params string) ([]byte, error) {
if g.HttpClient == nil {
g.HttpClient = DefaultHTTPClient
}
client := g.HttpClient
} Fwiw, I have a list of features that I'd like to see in a |
Great, It's on @enj , want to try it out and let me know if there's anything missing? If all is well, I'll close out this ticket 😄 🍻 |
Works like a charm, feel free to close. Thanks for the help. |
I am trying to use this library with Google App Engine which does not allow one to use the standard library to make HTTP requests. I ran into a similar issue with a Twitter API, but was able to replace the
http.Client
since it was exposed in the API.I believe a change like this could allow for a similar capability:
Thoughts?
The text was updated successfully, but these errors were encountered: