cli / oauth

A library for performing OAuth Device flow and Web application flow in Go client apps.
https://pkg.go.dev/github.com/cli/oauth
MIT License
460 stars 63 forks source link

create new func to avoid the bug on issue #61 #63

Open mouismail opened 2 months ago

mouismail commented 2 months ago

This pull request primarily focuses on improving error handling and code readability in the OAuth flow. The changes include the introduction of a new function NewGitHubHost in oauth.go to parse the host URL and return an error if parsing fails. This function is then used in the files examples_test.go, oauth_device.go, and oauth_webapp.go to replace the previous method of creating a new host, improving error handling in the process.