From fc4fab91f52944cf68d48193d827d8e762810414 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 2 Nov 2018 23:12:01 +1100 Subject: [PATCH] Switch to goimports import sorting Used to use sortimports, but it's old, and goimports seems to have an opinion now. --- Peer.go | 1 - Peers.go | 1 - bencode/decode.go | 6 +++--- client_test.go | 9 ++++----- cmd/magnet-metainfo/main.go | 1 - cmd/torrent-create/main.go | 1 - cmd/torrent-infohash/main.go | 1 - cmd/torrent-magnet/main.go | 1 - cmd/torrent-metainfo-pprint/main.go | 3 +-- cmd/torrent-pick/main.go | 5 ++--- cmd/torrent-verify/main.go | 5 ++--- cmd/torrent/main.go | 7 +++---- cmd/torrentfs/main.go | 1 - cmd/tracker-announce/main.go | 3 +-- config.go | 27 +++++++++++++-------------- connection.go | 3 +-- connection_test.go | 5 ++--- fs/file_handle.go | 1 - fs/filenode.go | 1 - fs/torrentfs.go | 1 - fs/torrentfs_test.go | 5 ++--- internal/testutil/spec.go | 1 - iplist/cmd/pack-blocklist/main.go | 1 - issue211_test.go | 5 ++--- issue97_test.go | 3 +-- metainfo/info_test.go | 3 +-- metainfo/metainfo_test.go | 3 +-- metainfo/nodes_test.go | 3 +-- misc.go | 3 +-- peer_protocol/handshake.go | 3 +-- peer_protocol/pex_test.go | 3 +-- piece.go | 1 - reader.go | 1 - reader_test.go | 3 +-- storage/boltPieceCompletion.go | 3 +-- storage/bolt_piece.go | 3 +-- storage/boltdb.go | 3 +-- storage/boltpc_test.go | 3 +-- storage/file.go | 1 - storage/file_misc_test.go | 3 +-- storage/file_test.go | 3 +-- storage/issue95_test.go | 3 +-- storage/issue96_test.go | 3 +-- storage/mmap.go | 3 +-- storage/piece_resource.go | 1 - storage/sqlitePieceCompletion.go | 3 +-- storage/wrappers.go | 1 - t.go | 1 - torrent.go | 3 +-- torrent_test.go | 7 +++---- tracker/http.go | 1 - tracker/http_test.go | 3 +-- tracker_scraper.go | 1 - util/dirwatch/dirwatch.go | 3 +-- 54 files changed, 60 insertions(+), 113 deletions(-) diff --git a/Peer.go b/Peer.go index a51d86c0..e4a7a2fb 100644 --- a/Peer.go +++ b/Peer.go @@ -4,7 +4,6 @@ import ( "net" "github.com/anacrolix/dht/krpc" - "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/Peers.go b/Peers.go index 9c3e062c..5d88bb3e 100644 --- a/Peers.go +++ b/Peers.go @@ -2,7 +2,6 @@ package torrent import ( "github.com/anacrolix/dht/krpc" - "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/tracker" ) diff --git a/bencode/decode.go b/bencode/decode.go index c60bf17a..03488999 100644 --- a/bencode/decode.go +++ b/bencode/decode.go @@ -243,9 +243,9 @@ func getDictField(dict reflect.Value, key string) dictField { }) } return dictField{ - Value: dict.FieldByIndex(sf.r.Index), - Ok: true, - Set: func() {}, + Value: dict.FieldByIndex(sf.r.Index), + Ok: true, + Set: func() {}, IgnoreUnmarshalTypeError: sf.tag.IgnoreUnmarshalTypeError(), } default: diff --git a/client_test.go b/client_test.go index ca4041cf..0b12128f 100644 --- a/client_test.go +++ b/client_test.go @@ -16,16 +16,15 @@ import ( _ "github.com/anacrolix/envpprof" "github.com/anacrolix/missinggo" "github.com/anacrolix/missinggo/filecache" - "github.com/bradfitz/iter" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "golang.org/x/time/rate" - "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/internal/testutil" "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/storage" + "github.com/bradfitz/iter" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "golang.org/x/time/rate" ) func TestingConfig() *ClientConfig { diff --git a/cmd/magnet-metainfo/main.go b/cmd/magnet-metainfo/main.go index 536f7abf..88965137 100644 --- a/cmd/magnet-metainfo/main.go +++ b/cmd/magnet-metainfo/main.go @@ -9,7 +9,6 @@ import ( _ "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" - "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/bencode" ) diff --git a/cmd/torrent-create/main.go b/cmd/torrent-create/main.go index 4a429e9b..d62f8fd5 100644 --- a/cmd/torrent-create/main.go +++ b/cmd/torrent-create/main.go @@ -5,7 +5,6 @@ import ( "os" "github.com/anacrolix/tagflag" - "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/metainfo" ) diff --git a/cmd/torrent-infohash/main.go b/cmd/torrent-infohash/main.go index 81319c99..10a7bad9 100644 --- a/cmd/torrent-infohash/main.go +++ b/cmd/torrent-infohash/main.go @@ -5,7 +5,6 @@ import ( "log" "github.com/anacrolix/tagflag" - "github.com/anacrolix/torrent/metainfo" ) diff --git a/cmd/torrent-magnet/main.go b/cmd/torrent-magnet/main.go index ee0ea2ec..a1d53077 100644 --- a/cmd/torrent-magnet/main.go +++ b/cmd/torrent-magnet/main.go @@ -5,7 +5,6 @@ import ( "os" "github.com/anacrolix/tagflag" - "github.com/anacrolix/torrent/metainfo" ) diff --git a/cmd/torrent-metainfo-pprint/main.go b/cmd/torrent-metainfo-pprint/main.go index 52c6c106..ec78facf 100644 --- a/cmd/torrent-metainfo-pprint/main.go +++ b/cmd/torrent-metainfo-pprint/main.go @@ -11,9 +11,8 @@ import ( "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" - "github.com/bradfitz/iter" - "github.com/anacrolix/torrent/metainfo" + "github.com/bradfitz/iter" ) var flags struct { diff --git a/cmd/torrent-pick/main.go b/cmd/torrent-pick/main.go index eada5687..07874e8a 100644 --- a/cmd/torrent-pick/main.go +++ b/cmd/torrent-pick/main.go @@ -15,11 +15,10 @@ import ( "time" _ "github.com/anacrolix/envpprof" - "github.com/dustin/go-humanize" - "github.com/jessevdk/go-flags" - "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/metainfo" + "github.com/dustin/go-humanize" + "github.com/jessevdk/go-flags" ) // fmt.Fprintf(os.Stderr, "Usage: %s \n", os.Args[0]) diff --git a/cmd/torrent-verify/main.go b/cmd/torrent-verify/main.go index dfd14a74..525cced8 100644 --- a/cmd/torrent-verify/main.go +++ b/cmd/torrent-verify/main.go @@ -10,11 +10,10 @@ import ( "path/filepath" "github.com/anacrolix/tagflag" - "github.com/bradfitz/iter" - "github.com/edsrzf/mmap-go" - "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/mmap_span" + "github.com/bradfitz/iter" + "github.com/edsrzf/mmap-go" ) func mmapFile(name string) (mm mmap.MMap, err error) { diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index abbb5521..2cdf886e 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -15,14 +15,13 @@ import ( "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" - "github.com/dustin/go-humanize" - "github.com/gosuri/uiprogress" - "golang.org/x/time/rate" - "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/storage" + "github.com/dustin/go-humanize" + "github.com/gosuri/uiprogress" + "golang.org/x/time/rate" ) var progress = uiprogress.New() diff --git a/cmd/torrentfs/main.go b/cmd/torrentfs/main.go index b2d34efe..5a02cec2 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -17,7 +17,6 @@ import ( fusefs "bazil.org/fuse/fs" _ "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" - "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/fs" "github.com/anacrolix/torrent/util/dirwatch" diff --git a/cmd/tracker-announce/main.go b/cmd/tracker-announce/main.go index e038d872..f2eb02e4 100644 --- a/cmd/tracker-announce/main.go +++ b/cmd/tracker-announce/main.go @@ -8,11 +8,10 @@ import ( "sync" "github.com/anacrolix/tagflag" - "github.com/davecgh/go-spew/spew" - "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/tracker" + "github.com/davecgh/go-spew/spew" ) func argSpec(arg string) (ts *torrent.TorrentSpec, err error) { diff --git a/config.go b/config.go index 964453af..31f22513 100644 --- a/config.go +++ b/config.go @@ -9,10 +9,9 @@ import ( "github.com/anacrolix/dht" "github.com/anacrolix/missinggo" "github.com/anacrolix/missinggo/expect" - "golang.org/x/time/rate" - "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/storage" + "golang.org/x/time/rate" ) var DefaultHTTPUserAgent = "Go-Torrent/1.0" @@ -136,18 +135,18 @@ func NewDefaultClientConfig() *ClientConfig { return &ClientConfig{ HTTPUserAgent: DefaultHTTPUserAgent, ExtendedHandshakeClientVersion: "go.torrent dev 20150624", - Bep20: "-GT0001-", - NominalDialTimeout: 20 * time.Second, - MinDialTimeout: 3 * time.Second, - EstablishedConnsPerTorrent: 50, - HalfOpenConnsPerTorrent: 25, - TorrentPeersHighWater: 500, - TorrentPeersLowWater: 50, - HandshakesTimeout: 4 * time.Second, - DhtStartingNodes: dht.GlobalBootstrapAddrs, - ListenHost: func(string) string { return "" }, - UploadRateLimiter: unlimited, - DownloadRateLimiter: unlimited, + Bep20: "-GT0001-", + NominalDialTimeout: 20 * time.Second, + MinDialTimeout: 3 * time.Second, + EstablishedConnsPerTorrent: 50, + HalfOpenConnsPerTorrent: 25, + TorrentPeersHighWater: 500, + TorrentPeersLowWater: 50, + HandshakesTimeout: 4 * time.Second, + DhtStartingNodes: dht.GlobalBootstrapAddrs, + ListenHost: func(string) string { return "" }, + UploadRateLimiter: unlimited, + DownloadRateLimiter: unlimited, } } diff --git a/connection.go b/connection.go index d0446e11..f58fca21 100644 --- a/connection.go +++ b/connection.go @@ -19,11 +19,10 @@ import ( "github.com/anacrolix/missinggo/bitmap" "github.com/anacrolix/missinggo/iter" "github.com/anacrolix/missinggo/prioritybitmap" - "github.com/pkg/errors" - "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/mse" pp "github.com/anacrolix/torrent/peer_protocol" + "github.com/pkg/errors" ) type peerSource string diff --git a/connection_test.go b/connection_test.go index 949c55f4..673b5e51 100644 --- a/connection_test.go +++ b/connection_test.go @@ -8,12 +8,11 @@ import ( "time" "github.com/anacrolix/missinggo/pubsub" - "github.com/bradfitz/iter" - "github.com/stretchr/testify/require" - "github.com/anacrolix/torrent/metainfo" pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/storage" + "github.com/bradfitz/iter" + "github.com/stretchr/testify/require" ) // Ensure that no race exists between sending a bitfield, and a subsequent diff --git a/fs/file_handle.go b/fs/file_handle.go index 41517296..48f3e507 100644 --- a/fs/file_handle.go +++ b/fs/file_handle.go @@ -7,7 +7,6 @@ import ( "bazil.org/fuse" "bazil.org/fuse/fs" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent" ) diff --git a/fs/filenode.go b/fs/filenode.go index a7c807b4..b3f513f4 100644 --- a/fs/filenode.go +++ b/fs/filenode.go @@ -5,7 +5,6 @@ import ( "bazil.org/fuse" fusefs "bazil.org/fuse/fs" - "github.com/anacrolix/torrent" ) diff --git a/fs/torrentfs.go b/fs/torrentfs.go index e143eca2..8e3e6898 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -9,7 +9,6 @@ import ( "bazil.org/fuse" fusefs "bazil.org/fuse/fs" - "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/metainfo" ) diff --git a/fs/torrentfs_test.go b/fs/torrentfs_test.go index 716ea5f8..4a37a351 100644 --- a/fs/torrentfs_test.go +++ b/fs/torrentfs_test.go @@ -17,13 +17,12 @@ import ( fusefs "bazil.org/fuse/fs" _ "github.com/anacrolix/envpprof" "github.com/anacrolix/missinggo" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/internal/testutil" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/storage" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func init() { diff --git a/internal/testutil/spec.go b/internal/testutil/spec.go index b2daa48b..90accb40 100644 --- a/internal/testutil/spec.go +++ b/internal/testutil/spec.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/anacrolix/missinggo/expect" - "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/metainfo" ) diff --git a/iplist/cmd/pack-blocklist/main.go b/iplist/cmd/pack-blocklist/main.go index 037ceeba..6ca81e05 100644 --- a/iplist/cmd/pack-blocklist/main.go +++ b/iplist/cmd/pack-blocklist/main.go @@ -8,7 +8,6 @@ import ( "github.com/anacrolix/missinggo" "github.com/anacrolix/tagflag" - "github.com/anacrolix/torrent/iplist" ) diff --git a/issue211_test.go b/issue211_test.go index dedbaa56..c12a9c9e 100644 --- a/issue211_test.go +++ b/issue211_test.go @@ -5,12 +5,11 @@ import ( "io/ioutil" "testing" + "github.com/anacrolix/torrent/internal/testutil" + "github.com/anacrolix/torrent/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "golang.org/x/time/rate" - - "github.com/anacrolix/torrent/internal/testutil" - "github.com/anacrolix/torrent/storage" ) func TestDropTorrentWithMmapStorageWhileHashing(t *testing.T) { diff --git a/issue97_test.go b/issue97_test.go index 5ccfa62e..5f36e67f 100644 --- a/issue97_test.go +++ b/issue97_test.go @@ -5,10 +5,9 @@ import ( "os" "testing" - "github.com/stretchr/testify/require" - "github.com/anacrolix/torrent/internal/testutil" "github.com/anacrolix/torrent/storage" + "github.com/stretchr/testify/require" ) func TestHashPieceAfterStorageClosed(t *testing.T) { diff --git a/metainfo/info_test.go b/metainfo/info_test.go index cf1eaf8f..bf2b9a1e 100644 --- a/metainfo/info_test.go +++ b/metainfo/info_test.go @@ -3,9 +3,8 @@ package metainfo import ( "testing" - "github.com/stretchr/testify/assert" - "github.com/anacrolix/torrent/bencode" + "github.com/stretchr/testify/assert" ) func TestMarshalInfo(t *testing.T) { diff --git a/metainfo/metainfo_test.go b/metainfo/metainfo_test.go index e54447ae..5521f919 100644 --- a/metainfo/metainfo_test.go +++ b/metainfo/metainfo_test.go @@ -9,10 +9,9 @@ import ( "testing" "github.com/anacrolix/missinggo" + "github.com/anacrolix/torrent/bencode" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/bencode" ) func testFile(t *testing.T, filename string) { diff --git a/metainfo/nodes_test.go b/metainfo/nodes_test.go index adebbb36..3e54b961 100644 --- a/metainfo/nodes_test.go +++ b/metainfo/nodes_test.go @@ -4,10 +4,9 @@ import ( "bytes" "testing" + "github.com/anacrolix/torrent/bencode" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/bencode" ) func testFileNodesMatch(t *testing.T, file string, nodes []Node) { diff --git a/misc.go b/misc.go index 5f7f66be..9d094383 100644 --- a/misc.go +++ b/misc.go @@ -5,10 +5,9 @@ import ( "net" "github.com/anacrolix/missinggo" - "golang.org/x/time/rate" - "github.com/anacrolix/torrent/metainfo" pp "github.com/anacrolix/torrent/peer_protocol" + "golang.org/x/time/rate" ) type chunkSpec struct { diff --git a/peer_protocol/handshake.go b/peer_protocol/handshake.go index e3389171..fe232948 100644 --- a/peer_protocol/handshake.go +++ b/peer_protocol/handshake.go @@ -6,7 +6,6 @@ import ( "io" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/metainfo" ) @@ -123,7 +122,7 @@ func Handshake(sock io.ReadWriter, ih *metainfo.Hash, peerID [20]byte, extension missinggo.CopyExact(&res.PeerExtensionBits, b[20:28]) missinggo.CopyExact(&res.Hash, b[28:48]) missinggo.CopyExact(&res.PeerID, b[48:68]) - // peerExtensions.Add(res.PeerExtensionBits.String(), 1) + // peerExtensions.Add(res.PeerExtensionBits.String(), 1) // TODO: Maybe we can just drop peers here if we're not interested. This // could prevent them trying to reconnect, falsely believing there was diff --git a/peer_protocol/pex_test.go b/peer_protocol/pex_test.go index 054c32be..59a17c87 100644 --- a/peer_protocol/pex_test.go +++ b/peer_protocol/pex_test.go @@ -3,9 +3,8 @@ package peer_protocol import ( "testing" - "github.com/stretchr/testify/require" - "github.com/anacrolix/torrent/bencode" + "github.com/stretchr/testify/require" ) func TestUnmarshalPex(t *testing.T) { diff --git a/piece.go b/piece.go index 6eef0cc1..e580754d 100644 --- a/piece.go +++ b/piece.go @@ -5,7 +5,6 @@ import ( "sync" "github.com/anacrolix/missinggo/bitmap" - "github.com/anacrolix/torrent/metainfo" pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/storage" diff --git a/reader.go b/reader.go index 71ddd480..07eefc87 100644 --- a/reader.go +++ b/reader.go @@ -8,7 +8,6 @@ import ( "sync" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/reader_test.go b/reader_test.go index 86021dd6..c8ea81d8 100644 --- a/reader_test.go +++ b/reader_test.go @@ -5,9 +5,8 @@ import ( "testing" "time" - "github.com/stretchr/testify/require" - "github.com/anacrolix/torrent/internal/testutil" + "github.com/stretchr/testify/require" ) func TestReaderReadContext(t *testing.T) { diff --git a/storage/boltPieceCompletion.go b/storage/boltPieceCompletion.go index d0accb1d..f0e21dc1 100644 --- a/storage/boltPieceCompletion.go +++ b/storage/boltPieceCompletion.go @@ -6,9 +6,8 @@ import ( "path/filepath" "time" - "github.com/boltdb/bolt" - "github.com/anacrolix/torrent/metainfo" + "github.com/boltdb/bolt" ) const ( diff --git a/storage/bolt_piece.go b/storage/bolt_piece.go index 35120e0e..a9e22bba 100644 --- a/storage/bolt_piece.go +++ b/storage/bolt_piece.go @@ -4,9 +4,8 @@ import ( "encoding/binary" "github.com/anacrolix/missinggo/x" - "github.com/boltdb/bolt" - "github.com/anacrolix/torrent/metainfo" + "github.com/boltdb/bolt" ) type boltDBPiece struct { diff --git a/storage/boltdb.go b/storage/boltdb.go index 56c711ff..30f38c65 100644 --- a/storage/boltdb.go +++ b/storage/boltdb.go @@ -6,9 +6,8 @@ import ( "time" "github.com/anacrolix/missinggo/expect" - "github.com/boltdb/bolt" - "github.com/anacrolix/torrent/metainfo" + "github.com/boltdb/bolt" ) const ( diff --git a/storage/boltpc_test.go b/storage/boltpc_test.go index 53fdbdb5..cce7c910 100644 --- a/storage/boltpc_test.go +++ b/storage/boltpc_test.go @@ -5,10 +5,9 @@ import ( "os" "testing" + "github.com/anacrolix/torrent/metainfo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/metainfo" ) func TestBoltPieceCompletion(t *testing.T) { diff --git a/storage/file.go b/storage/file.go index fd4d5601..d01b53af 100644 --- a/storage/file.go +++ b/storage/file.go @@ -6,7 +6,6 @@ import ( "path/filepath" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/metainfo" ) diff --git a/storage/file_misc_test.go b/storage/file_misc_test.go index 8b453045..9c646345 100644 --- a/storage/file_misc_test.go +++ b/storage/file_misc_test.go @@ -3,9 +3,8 @@ package storage import ( "testing" - "github.com/stretchr/testify/assert" - "github.com/anacrolix/torrent/metainfo" + "github.com/stretchr/testify/assert" ) func TestExtentCompleteRequiredLengths(t *testing.T) { diff --git a/storage/file_test.go b/storage/file_test.go index 1a5e1b60..719b98f2 100644 --- a/storage/file_test.go +++ b/storage/file_test.go @@ -9,10 +9,9 @@ import ( "testing" "github.com/anacrolix/missinggo" + "github.com/anacrolix/torrent/metainfo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/metainfo" ) func TestShortFile(t *testing.T) { diff --git a/storage/issue95_test.go b/storage/issue95_test.go index d47410da..9043eb4e 100644 --- a/storage/issue95_test.go +++ b/storage/issue95_test.go @@ -6,10 +6,9 @@ import ( "testing" "github.com/anacrolix/missinggo/resource" + "github.com/anacrolix/torrent/metainfo" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/metainfo" ) // Two different torrents opened from the same storage. Closing one should not diff --git a/storage/issue96_test.go b/storage/issue96_test.go index 1bdbbf15..21158f99 100644 --- a/storage/issue96_test.go +++ b/storage/issue96_test.go @@ -5,9 +5,8 @@ import ( "os" "testing" - "github.com/stretchr/testify/require" - "github.com/anacrolix/torrent/metainfo" + "github.com/stretchr/testify/require" ) func testMarkedCompleteMissingOnRead(t *testing.T, csf func(string) ClientImpl) { diff --git a/storage/mmap.go b/storage/mmap.go index 8bce4dc7..53455467 100644 --- a/storage/mmap.go +++ b/storage/mmap.go @@ -8,10 +8,9 @@ import ( "path/filepath" "github.com/anacrolix/missinggo" - "github.com/edsrzf/mmap-go" - "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/mmap_span" + "github.com/edsrzf/mmap-go" ) type mmapClientImpl struct { diff --git a/storage/piece_resource.go b/storage/piece_resource.go index 1064fae5..8f6f9063 100644 --- a/storage/piece_resource.go +++ b/storage/piece_resource.go @@ -4,7 +4,6 @@ import ( "path" "github.com/anacrolix/missinggo/resource" - "github.com/anacrolix/torrent/metainfo" ) diff --git a/storage/sqlitePieceCompletion.go b/storage/sqlitePieceCompletion.go index 508b4fa4..5a859d23 100644 --- a/storage/sqlitePieceCompletion.go +++ b/storage/sqlitePieceCompletion.go @@ -6,9 +6,8 @@ import ( "database/sql" "path/filepath" - _ "github.com/mattn/go-sqlite3" - "github.com/anacrolix/torrent/metainfo" + _ "github.com/mattn/go-sqlite3" ) type sqlitePieceCompletion struct { diff --git a/storage/wrappers.go b/storage/wrappers.go index 4fc0e10d..c706e8dc 100644 --- a/storage/wrappers.go +++ b/storage/wrappers.go @@ -5,7 +5,6 @@ import ( "os" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/metainfo" ) diff --git a/t.go b/t.go index c66935c2..04326206 100644 --- a/t.go +++ b/t.go @@ -4,7 +4,6 @@ import ( "strings" "github.com/anacrolix/missinggo/pubsub" - "github.com/anacrolix/torrent/metainfo" ) diff --git a/torrent.go b/torrent.go index 0b13fe25..9400bf28 100644 --- a/torrent.go +++ b/torrent.go @@ -24,13 +24,12 @@ import ( "github.com/anacrolix/missinggo/prioritybitmap" "github.com/anacrolix/missinggo/pubsub" "github.com/anacrolix/missinggo/slices" - "github.com/davecgh/go-spew/spew" - "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/metainfo" pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/storage" "github.com/anacrolix/torrent/tracker" + "github.com/davecgh/go-spew/spew" ) func (t *Torrent) chunkIndexSpec(chunkIndex pp.Integer, piece pieceIndex) chunkSpec { diff --git a/torrent_test.go b/torrent_test.go index 22053794..22646ef2 100644 --- a/torrent_test.go +++ b/torrent_test.go @@ -8,15 +8,14 @@ import ( "testing" "github.com/anacrolix/missinggo" - "github.com/bradfitz/iter" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/internal/testutil" "github.com/anacrolix/torrent/metainfo" pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/storage" + "github.com/bradfitz/iter" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func r(i, b, l pp.Integer) request { diff --git a/tracker/http.go b/tracker/http.go index 58d9dc11..69764040 100644 --- a/tracker/http.go +++ b/tracker/http.go @@ -13,7 +13,6 @@ import ( "github.com/anacrolix/dht/krpc" "github.com/anacrolix/missinggo/httptoo" - "github.com/anacrolix/torrent/bencode" ) diff --git a/tracker/http_test.go b/tracker/http_test.go index c90a35ef..1defeb85 100644 --- a/tracker/http_test.go +++ b/tracker/http_test.go @@ -3,10 +3,9 @@ package tracker import ( "testing" + "github.com/anacrolix/torrent/bencode" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/bencode" ) var defaultHTTPUserAgent = "Go-Torrent" diff --git a/tracker_scraper.go b/tracker_scraper.go index 0a87c868..5f31a019 100644 --- a/tracker_scraper.go +++ b/tracker_scraper.go @@ -10,7 +10,6 @@ import ( "github.com/anacrolix/dht/krpc" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/tracker" ) diff --git a/util/dirwatch/dirwatch.go b/util/dirwatch/dirwatch.go index 018d3f42..3f784a73 100644 --- a/util/dirwatch/dirwatch.go +++ b/util/dirwatch/dirwatch.go @@ -10,9 +10,8 @@ import ( "strings" "github.com/anacrolix/missinggo" - "github.com/fsnotify/fsnotify" - "github.com/anacrolix/torrent/metainfo" + "github.com/fsnotify/fsnotify" ) type Change uint -- 2.48.1