mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-25 00:58:10 -07:00
Address easy golint comments
This commit is contained in:
@@ -210,7 +210,7 @@ func (c *Conn) PurgeInactivePeers(purgeEmptyTorrents bool, before time.Time) err
|
||||
index := 0
|
||||
keys := make([]string, len(c.torrents))
|
||||
|
||||
for infohash, _ := range c.torrents {
|
||||
for infohash := range c.torrents {
|
||||
keys[index] = infohash
|
||||
index++
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ type PeerKey string
|
||||
func NewPeerKey(peerID string, ipv6 bool) PeerKey {
|
||||
if ipv6 {
|
||||
return PeerKey("6:" + peerID)
|
||||
} else {
|
||||
return PeerKey("4:" + peerID)
|
||||
}
|
||||
|
||||
return PeerKey("4:" + peerID)
|
||||
}
|
||||
|
||||
// PeerMap is a map from PeerKeys to Peers.
|
||||
|
||||
Reference in New Issue
Block a user