From 35064425eb435947240f6321a2504f6a9ce00ba5 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 9 Sep 2021 22:51:24 +1000 Subject: [PATCH] go fmt ./... --- client.go | 6 ++---- peer_protocol/handshake.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index 7d0b1f3c..fe831900 100644 --- 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 { diff --git a/peer_protocol/handshake.go b/peer_protocol/handshake.go index ba81a0cf..c0b0319d 100644 --- a/peer_protocol/handshake.go +++ b/peer_protocol/handshake.go @@ -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) }