Skip to content

Commit

Permalink
fix: sort builders by name
Browse files Browse the repository at this point in the history
  • Loading branch information
ViRb3 committed Aug 3, 2021
1 parent 60bb976 commit 8fad057
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"net/url"
"os"
"path"
"sort"
"strings"
textTemplate "text/template"
"time"
Expand Down Expand Up @@ -602,6 +603,11 @@ func renderIndex(c echo.Context) error {
Name: builderId,
})
}
sort.Slice(data.Builders, func(i, j int) bool {
name1 := data.Builders[i].Name
name2 := data.Builders[j].Name
return name1 < name2
})
t, err := htmlTemplate.New("").Parse(assets.IndexHtml)
if err != nil {
return err
Expand Down

0 comments on commit 8fad057

Please sign in to comment.