]> Sergey Matveev's repositories - btrtrc.git/commitdiff
go fmt ./...
authorMatt Joiner <anacrolix@gmail.com>
Thu, 9 Sep 2021 12:51:24 +0000 (22:51 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 9 Sep 2021 12:51:24 +0000 (22:51 +1000)
client.go
peer_protocol/handshake.go

index 7d0b1f3c1ec7f944e58898a38e5bd0cb99331284..fe83190072738e63f9a63670befe47b97790fd30 100644 (file)
--- a/client.go
+++ b/client.go
@@ -102,7 +102,6 @@ func (cl *Client) badPeerIPsLocked() (ips []string) {
        return
 }
 
-
 func (cl *Client) PeerID() PeerID {
        return cl.peerID
 }
@@ -420,8 +419,8 @@ func (cl *Client) eachDhtServer(f func(DhtServer)) {
 // Stops the client. All connections to peers are closed and all activity will
 // come to a halt.
 func (cl *Client) Close() {
-       var closeGroup sync.WaitGroup //WaitGroup for any concurrent cleanup to complete before returning.
-       defer closeGroup.Wait() //defer is LIFO. We want to Wait() after cl.unlock()
+       var closeGroup sync.WaitGroup // WaitGroup for any concurrent cleanup to complete before returning.
+       defer closeGroup.Wait()       // defer is LIFO. We want to Wait() after cl.unlock()
        cl.lock()
        defer cl.unlock()
        cl.closed.Set()
@@ -1259,7 +1258,6 @@ func useTorrentSource(ctx context.Context, source string, t *Torrent) (err error
        return t.MergeSpec(TorrentSpecFromMetaInfo(&mi))
 }
 
-
 func (cl *Client) dropTorrent(infoHash metainfo.Hash) (err error) {
        t, ok := cl.torrents[infoHash]
        if !ok {
index ba81a0cf385974123f5734dd990c6780364009f9..c0b0319d34758f3a00837449ef127bf7936f834a 100644 (file)
@@ -126,7 +126,7 @@ func Handshake(
 
        copyExact := func(dst []byte, src []byte) {
                if dstLen, srcLen := uint64(len(dst)), uint64(len(src)); dstLen != srcLen {
-                       panic("dst len " + strconv.FormatUint(dstLen,10) + " != src len " + strconv.FormatUint(srcLen,10))
+                       panic("dst len " + strconv.FormatUint(dstLen, 10) + " != src len " + strconv.FormatUint(srcLen, 10))
                }
                copy(dst, src)
        }