Hardcoded http.Client prohibits the user from specifying custom timeouts, setting custom cookies etc. Especially the lack of timeouts is deadly as the default client never times out.
Additionally there is no way to use the library multiple times with different http clients without authenticating in order to use the provided constructor functions.
Solution: make the http field of the Client struct public to allow people to set their own httpClient and instantiate the Client at will.
The fact that after this change a global variable in the library will have a state which can be modified externally will however make the NoAuthClient by definition broken which should be noted in the comment above it (as removing it is not an option now without changing the library's API).
Hardcoded
http.Clientprohibits the user from specifying custom timeouts, setting custom cookies etc. Especially the lack of timeouts is deadly as the default client never times out.Additionally there is no way to use the library multiple times with different http clients without authenticating in order to use the provided constructor functions.
Solution: make the
httpfield of theClientstruct public to allow people to set their own httpClient and instantiate theClientat will.The fact that after this change a global variable in the library will have a state which can be modified externally will however make the
NoAuthClientby definition broken which should be noted in the comment above it (as removing it is not an option now without changing the library's API).