zmb3 / spotify

A Go wrapper for the Spotify Web API
Apache License 2.0
1.34k stars 284 forks source link

Allow client creation from authorizing HTTP client #123

Closed CodyDWJones closed 4 years ago

CodyDWJones commented 4 years ago

This change allows apps to supply a http.Client they already have, rather than relying on the Authenticator helper. An app might use common code to obtain an auth'd http.Client because it interacts with many OAuth services.

CodyDWJones commented 4 years ago

I didn't realize #107 had been submitted. Either approach satisfies my requirement. #107 is more future proof (if a non-exported field is added to Client) but until then quite a bit more verbose.

zmb3 commented 4 years ago

Thanks for this, #107 is probably a nicer approach, but this is 100% backwards compatible so I'll merge this and we'll keep #107 around in case somebody wants to work on a v2 of this library.