Sort agents
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"log/slog"
|
"log/slog"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -113,6 +114,10 @@ func (a *AgentPool) List() []string {
|
|||||||
for agent := range a.pool {
|
for agent := range a.pool {
|
||||||
agents = append(agents, agent)
|
agents = append(agents, agent)
|
||||||
}
|
}
|
||||||
|
// return a sorted list
|
||||||
|
sort.SliceStable(agents, func(i, j int) bool {
|
||||||
|
return agents[i] < agents[j]
|
||||||
|
})
|
||||||
return agents
|
return agents
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user