cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

Add repository.ParseWithHost #41

Closed samcoe closed 2 years ago

samcoe commented 2 years ago

This PR adds a repository.ParseWithHost function that is necessary for gh to use go-gh for parsing repository strings. Additionally, it changes repository.Parse to now look at the config file for a viable host instead of just looking at GH_HOST before defaulting to github.com. This new behavior also matches the current functionality in gh.

cc https://github.com/cli/cli/issues/5560 corresponds to https://github.com/cli/cli/pull/5655