Currently, GitHub has two types of URLs: one is SSH, another is HTTPS. The getHostname function seems not to support HTTPS URL; therefore, gh-poi panics due to no matches in case of using HTTPS URL.
⠋ Fetching pull requests... panic: runtime error: index out of range [1] with length 0
goroutine 1 [running]:
main.getHostname({0x1400017a000, 0x6f})
/home/runner/work/gh-poi/gh-poi/poi.go:106 +0xc4
main.GetBranches({0x100dc2d18, 0x100ea22f0})
/home/runner/work/gh-poi/gh-poi/poi.go:67 +0x5c
main.main()
/home/runner/work/gh-poi/gh-poi/main.go:38 +0x278
This PR brings a new regex that matches also HTTPS. You can check it out on regex101.com.
Currently, GitHub has two types of URLs: one is SSH, another is HTTPS. The
getHostname
function seems not to support HTTPS URL; therefore,gh-poi
panics due to no matches in case of using HTTPS URL.This PR brings a new regex that matches also HTTPS. You can check it out on regex101.com.