Skip to content
Snippets Groups Projects
Commit b605b84d authored by Tamer Tas's avatar Tamer Tas
Browse files

pkg/host: refactor zipURL calculation

parent 2aea094a
No related branches found
No related tags found
No related merge requests found
...@@ -13,14 +13,14 @@ func ZipURL(repo string) string { ...@@ -13,14 +13,14 @@ func ZipURL(repo string) string {
repo = strings.TrimSuffix(strings.TrimPrefix(repo, "/"), "/") repo = strings.TrimSuffix(strings.TrimPrefix(repo, "/"), "/")
zipRegex, _ := regexp.Compile(`zip/(\S+)$`) zipRegex := regexp.MustCompile(`zip/(\S+)$`)
if zipRegex.MatchString(repo) { if zipRegex.MatchString(repo) {
return repo return repo
} }
// So this could identify a port number, but since we only support github // FIXME(tmrts): this check could also identify a port number, but since
// I don't believe using it as a version modifier is a problem. Though // we only support github I don't believe using it as a version modifier
// perhaps we should use something else instead? // is a problem. Perhaps we should reconsider?
if strings.Contains(repo, ":") { if strings.Contains(repo, ":") {
parts := strings.SplitAfter(repo, ":") parts := strings.SplitAfter(repo, ":")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment