Skip to content
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

Not re/using default HTTP Client #4

Open
MarinX opened this issue Feb 21, 2019 · 0 comments
Open

Not re/using default HTTP Client #4

MarinX opened this issue Feb 21, 2019 · 0 comments

Comments

@MarinX
Copy link

MarinX commented Feb 21, 2019

When doing a request, each new client is created with none default values.
This can cause a problem if something happens with API and client can hang infinitive because there is no timeout set.

Also, as suggested by go doc: Clients should be reused instead of created as needed. Clients are safe for concurrent use by multiple goroutines.
It should also let the users set their own HTTP client, if none, use http.DefaultClient

If this is something you agree on changing, I can create a valid PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant