Skip to content

Commit

Permalink
fix: remove go prefix in getGolangVersions
Browse files Browse the repository at this point in the history
  • Loading branch information
juev committed Dec 8, 2023
1 parent b278466 commit 685b874
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gobrew.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (gb *GoBrew) getLatestVersion() string {
r := regexp.MustCompile("beta.*|rc.*")
matches := r.FindAllString(getGolangVersions[i], -1)
if len(matches) == 0 {
return strings.ReplaceAll(getGolangVersions[i], "go", "")
return getGolangVersions[i]
}
}
return ""
Expand Down Expand Up @@ -282,7 +282,7 @@ func (gb *GoBrew) ListRemoteVersions(print bool) map[string][]string {

var versions []string
for _, tag := range tags {
versions = append(versions, strings.ReplaceAll(tag, "go", ""))
versions = append(versions, tag)
}

return gb.getGroupedVersion(versions, print)
Expand Down Expand Up @@ -765,7 +765,7 @@ func (gb *GoBrew) getGolangVersions() (result []string) {
for _, tag := range tags {
t := strings.ReplaceAll(tag.Ref, "refs/tags/", "")
if strings.HasPrefix(t, "go") {
result = append(result, t)
result = append(result, strings.TrimPrefix(t, "go"))
}
}

Expand Down

0 comments on commit 685b874

Please sign in to comment.