Skip to content

Commit

Permalink
[psy] Fix git semver sorting tool
Browse files Browse the repository at this point in the history
  • Loading branch information
psyomn committed Apr 14, 2021
1 parent 8267e85 commit aa196ee
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions psy/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ func Run(_ common.RunParams) common.RunReturn {
outputStr := string(output)
lines := strings.Split(outputStr, "\n")

semvers := make([]*semver.Version, len(lines))

semvers := make([]*semver.Version, 0)
for index := range lines {
if lines[index] == "" {
// last line might be blank; ignore
Expand All @@ -58,7 +57,7 @@ func Run(_ common.RunParams) common.RunReturn {
continue
}

semvers[index] = v
semvers = append(semvers, v)
}

sort.Sort(semver.Collection(semvers))
Expand Down

0 comments on commit aa196ee

Please sign in to comment.