Skip to content

Commit

Permalink
chore(list-remote): list go versions in the reverse order
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitcharolia committed Jan 29, 2024
1 parent ae1a357 commit 816a451
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ func listRemoteVersions() {
log.Fatalf("Failed to decode JSON response: %v", err)
}

for _, v := range versions {
version := strings.TrimPrefix(v.Version, "go")
// Print the versions in reverse order
for i := len(versions) - 1; i >= 0; i-- {
version := strings.TrimPrefix(versions[i].Version, "go")
fmt.Println(version)
}
}
Expand Down

0 comments on commit 816a451

Please sign in to comment.