Skip to content

Commit

Permalink
lint: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Mar 28, 2023
1 parent 2069bfc commit 0c2221b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/boost/provider_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ var libp2pInfoCmd = &cli.Command{
if err != nil {
return fmt.Errorf("getting protocols for peer %s: %w", addrInfo.ID, err)
}
sort.Strings(protos)
protostrs := make([]string, 0, len(protos))
for _, proto := range protos {
protostrs = append(protostrs, string(proto))
}
sort.Strings(protostrs)

agentVersionI, err := n.Host.Peerstore().Get(addrInfo.ID, "AgentVersion")
if err != nil {
Expand All @@ -98,7 +102,7 @@ var libp2pInfoCmd = &cli.Command{
"agent": agentVersion,
"id": addrInfo.ID.String(),
"multiaddrs": addrInfo.Addrs,
"protocols": protos,
"protocols": protostrs,
})
}

Expand All @@ -109,7 +113,7 @@ var libp2pInfoCmd = &cli.Command{
for _, addr := range addrInfo.Addrs {
fmt.Println(" " + addr.String())
}
fmt.Println("Protocols:\n" + " " + strings.Join(protos, "\n "))
fmt.Println("Protocols:\n" + " " + strings.Join(protostrs, "\n "))
return nil
},
}
Expand Down

0 comments on commit 0c2221b

Please sign in to comment.