Skip to content

Commit ad3dbf4

Browse files
feat: sort radios
1 parent f267f17 commit ad3dbf4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/radio/hub.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"log"
7+
"sort"
78
"sync"
89
"time"
910

@@ -168,5 +169,10 @@ func (hs *HubServiceImpl) List() []Radio {
168169
}
169170
hs.radiosMapMu.RUnlock()
170171

172+
// Sort radios
173+
sort.Slice(radios, func(i, j int) bool {
174+
return radios[i].UUID < radios[j].UUID
175+
})
176+
171177
return radios
172178
}

0 commit comments

Comments
 (0)