Merge pull request #873 from filecoin-project/feat/stable-netpeers

Stable net peers output
This commit is contained in:
Łukasz Magiera 2019-12-11 22:02:54 +01:00 committed by GitHub
commit d3d2b7c125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
} }