-
Notifications
You must be signed in to change notification settings - Fork 81
Closed
Description
Description
See bug report: cli/cli#9248
TL;DR: The current host parsing function is non-idiomatic and hides errors opening the possibility for panics. We can't change the existing function without a breaking change so we will introduce a new function with signature func NewHost(hostname string) (*Host, error).
Lines 28 to 36 in adf5f73
| func GitHubHost(hostURL string) *Host { | |
| u, _ := url.Parse(hostURL) | |
| return &Host{ | |
| DeviceCodeURL: fmt.Sprintf("%s://%s/login/device/code", u.Scheme, u.Host), | |
| AuthorizeURL: fmt.Sprintf("%s://%s/login/oauth/authorize", u.Scheme, u.Host), | |
| TokenURL: fmt.Sprintf("%s://%s/login/oauth/access_token", u.Scheme, u.Host), | |
| } | |
| } |
Metadata
Metadata
Assignees
Labels
No labels