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

Proposal: Move methods off of Client #2936

Closed
WillAbides opened this issue Sep 20, 2023 · 1 comment · Fixed by #2937
Closed

Proposal: Move methods off of Client #2936

WillAbides opened this issue Sep 20, 2023 · 1 comment · Fixed by #2937

Comments

@WillAbides
Copy link
Contributor

Tooling like update-urls and metadata could be simpler if API calls were made from methods on a *Service receiver. I think it would also make more sense for humans using go-github.

Currently there are handful of Client methods such as that would logically belong on different receivers. I propose we create the appropriate Service types for these.

The changes would be would be:

  • Client.Markdown -> MarkdownService.Markdown (maybe rename it to RenderMarkdown while we are at it)
  • Client.ListEmojis -> EmojisService.ListEmojis
  • Client.ListCodesOfConduct -> CodesOfConductService.ListCodesOfConduct
  • Client.GetCodeOfConduct -> CodesOfConductService.GetCodeOfConduct
  • Client.APIMeta -> MetaService.APIMeta
  • Client.Octocat -> MetaService.Octocat
  • Client.Zen -> MetaService.Zen

The original methods would be updated to call their new equivalent and marked deprecated.

@WillAbides
Copy link
Contributor Author

Or we could create a MiscService and put them all in there.

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 a pull request may close this issue.

1 participant