Skip to content

Conversation

@dkhalizov
Copy link

Brief Summary of Changes

Modified the Client field in admin.API and uploader.API structs to be a pointer (*http.Client) instead of a value (http.Client). The corresponding initialization in NewWithConfiguration now uses the shared http.DefaultClient instead of http.Client{}.

What does this PR address?

  • GitHub issue (Add reference - #XX)
  • Refactoring
  • New feature
  • Bug fix
  • Adds more tests

Are tests included?

  • Yes
  • No (Assuming no new tests were added for this specific refactor)

Reviewer, please note:

This refactoring aligns http.Client usage with Go best practices. By using a pointer (*http.Client) and initializing with http.DefaultClient, we ensure efficient HTTP connection pooling via the underlying transport and better resource management, especially under load. No functional change is expected when using the default client, but resource utilization is improved.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation. (Likely no change needed for user-facing docs, but maintainer can confirm)
  • I ran the full test suite before pushing the changes and all the tests pass.

@const-cloudinary
Copy link
Collaborator

@dkhalizov , thank you for contribution!

It looks like it will introduce a breaking change for someone who implemented/used their own client. This will require bumping a major version of this library. How critical is this change?

@dkhalizov dkhalizov closed this by deleting the head repository May 29, 2025
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

Successfully merging this pull request may close these issues.

2 participants