From fd8995dcfd192a5678e329cb5688b5978382c422 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 5 Oct 2021 17:48:52 +1100 Subject: [PATCH] go fmt ./... --- global.go | 4 ++-- reader.go | 9 ++++----- t.go | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/global.go b/global.go index 4e48d0c5..bd94fe55 100644 --- a/global.go +++ b/global.go @@ -10,10 +10,10 @@ import ( const ( pieceHash = crypto.SHA1 defaultChunkSize = 0x4000 // 16KiB - + // Arbitrary maximum of "metadata_size" (see https://www.bittorrent.org/beps/bep_0009.html) // This value is 2x what libtorrent-rasterbar uses, which should be plenty - maxMetadataSize uint32 = 8*1024*1024 + maxMetadataSize uint32 = 8 * 1024 * 1024 ) // These are our extended message IDs. Peers will use these values to diff --git a/reader.go b/reader.go index 3b407ce3..bdeb34f6 100644 --- a/reader.go +++ b/reader.go @@ -30,15 +30,15 @@ type pieceRange struct { } type reader struct { - t *Torrent + t *Torrent // Adjust the read/seek window to handle Readers locked to File extents and the like. offset, length int64 - + // Function to dynamically calculate readahead. If nil, readahead is static. readaheadFunc func() int64 - + // Required when modifying pos and readahead. - mu sync.Locker + mu sync.Locker readahead, pos int64 // Position that reads have continued contiguously from. @@ -52,7 +52,6 @@ type reader struct { // after a seek or with a new reader at the starting position. reading bool responsive bool - } var _ io.ReadSeekCloser = (*reader)(nil) diff --git a/t.go b/t.go index 2c076386..51c76d5b 100644 --- a/t.go +++ b/t.go @@ -78,7 +78,7 @@ func (t *Torrent) PieceState(piece pieceIndex) (ps PieceState) { t.cl.rLock() ps = t.pieceState(piece) t.cl.rUnlock() - return + return } // The number of pieces in the torrent. This requires that the info has been -- 2.48.1