Merge pull request #873 from filecoin-project/feat/stable-netpeers
Stable net peers output
This commit is contained in:
commit
d3d2b7c125
@ -2,6 +2,8 @@ package cli
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"gopkg.in/urfave/cli.v2"
|
"gopkg.in/urfave/cli.v2"
|
||||||
|
|
||||||
@ -34,6 +36,10 @@ var netPeers = &cli.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort.Slice(peers, func(i, j int) bool {
|
||||||
|
return strings.Compare(string(peers[i].ID), string(peers[j].ID)) > 0
|
||||||
|
})
|
||||||
|
|
||||||
for _, peer := range peers {
|
for _, peer := range peers {
|
||||||
fmt.Println(peer)
|
fmt.Println(peer)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user