Skip to content

Commit

Permalink
refactor: better default bases sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
dd84ai committed Mar 26, 2024
1 parent 7ebf84b commit e90e866
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions darkstat/linker/linker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ into stuff rendered by fl-darkstat

import (
"fmt"
"sort"

"github.com/darklab8/fl-configs/configs/configs_export"
"github.com/darklab8/fl-configs/configs/configs_mapped"
Expand Down Expand Up @@ -44,6 +45,10 @@ func NewLinker(opts ...LinkOption) *Linker {
func (l *Linker) Link() *builder.Builder {
bases := l.configs.Bases(configs_export.NoNameIncluded(false))

sort.Slice(bases, func(i, j int) bool {
return bases[i].Name < bases[j].Name
})

build := builder.NewBuilder()
build.RegComps(
builder.NewComponent(
Expand Down

0 comments on commit e90e866

Please sign in to comment.