Skip to content

Commit

Permalink
feat: do not use slices package for currentVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
juev committed Dec 7, 2023
1 parent 01a10fa commit cf33539
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gobrew.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"path/filepath"
"regexp"
"runtime"
"slices"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -434,8 +433,8 @@ func (gb *GoBrew) CurrentVersion() string {

version := strings.TrimSuffix(fp, strings.Join([]string{"go", "bin"}, string(os.PathSeparator)))
paths := strings.Split(version, string(os.PathSeparator))
slices.Reverse(paths)
for _, version = range paths {
for i := len(paths) - 1; i >= 0; i-- {
version = paths[i]
if version != "" {
break
}
Expand Down

0 comments on commit cf33539

Please sign in to comment.