Skip to content

Commit

Permalink
add missing sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
h44z committed Oct 23, 2020
1 parent c1203ff commit 481cf4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/status.go
Expand Up @@ -7,6 +7,7 @@ import (
"io/ioutil"
"net/http"
"os"
"sort"
"time"

"gitlab.127-0-0-1.fr/vx3r/wg-gen-web/model"
Expand Down Expand Up @@ -172,5 +173,10 @@ func ReadClientStatus() ([]*model.ClientStatus, error) {

clientStatus = append(clientStatus, newClientStatus)
}

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

return clientStatus, nil
}

0 comments on commit 481cf4b

Please sign in to comment.