Peer.go | 1 + Peers.go | 1 + bencode/bench_test.go | 3 ++- client.go | 11 ++++++----- client_test.go | 1 + 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 | 1 + config.go | 3 ++- conn_stats.go | 2 +- 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/iplist/main.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 | 1 + peer_protocol/pex_test.go | 3 ++- 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 | 1 + torrent_test.go | 7 ++++--- tracker/http.go | 1 + tracker/http_test.go | 3 ++- tracker_scraper.go | 1 + util/dirwatch/dirwatch.go | 3 ++- diff --git a/Peer.go b/Peer.go index 85f673b53275c5b9267d45491bf932aac5f7b46d..5f63e6ed1afc932d3721011300c30447469d3f02 100644 --- a/Peer.go +++ b/Peer.go @@ -4,6 +4,7 @@ import ( "net" "github.com/anacrolix/dht/v2/krpc" + "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/Peers.go b/Peers.go index 32d902fb999b80f4f8ce30d038879108ced0fe5f..be70203268675cb6cd417c5ae55ee4724808a096 100644 --- a/Peers.go +++ b/Peers.go @@ -2,6 +2,7 @@ package torrent import ( "github.com/anacrolix/dht/v2/krpc" + "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/tracker" ) diff --git a/bencode/bench_test.go b/bencode/bench_test.go index f89e44dc141449397b3b65f21c710909038c969e..f5fb0a7a79f1a976d4ee007d154de4f5178e65e9 100644 --- a/bencode/bench_test.go +++ b/bencode/bench_test.go @@ -6,8 +6,9 @@ "reflect" "testing" "github.com/anacrolix/dht/v2/krpc" + "github.com/bradfitz/iter" + "github.com/anacrolix/torrent/bencode" - "github.com/bradfitz/iter" ) func marshalAndUnmarshal(tb testing.TB, orig krpc.Msg) (ret krpc.Msg) { diff --git a/client.go b/client.go index 52e48bb4c59e0c0d7400db2df70c1b10b6709102..4443c9af543c88f21b3786c36e5f352d97e50f4d 100644 --- a/client.go +++ b/client.go @@ -27,17 +27,18 @@ "github.com/anacrolix/missinggo/pproffd" "github.com/anacrolix/missinggo/pubsub" "github.com/anacrolix/missinggo/slices" "github.com/anacrolix/sync" + "github.com/davecgh/go-spew/spew" + "github.com/dustin/go-humanize" + "github.com/google/btree" + "golang.org/x/time/rate" + "golang.org/x/xerrors" + "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/mse" pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/storage" - "github.com/davecgh/go-spew/spew" - "github.com/dustin/go-humanize" - "github.com/google/btree" - "golang.org/x/time/rate" - "golang.org/x/xerrors" ) // Clients contain zero or more Torrents. A Client manages a blocklist, the diff --git a/client_test.go b/client_test.go index b896ed7bd37ce0e59e9d6f067a27e2232c04d63a..b84b9f3b9f41e38c0c529d86f87347de2d33017c 100644 --- a/client_test.go +++ b/client_test.go @@ -21,6 +21,7 @@ "github.com/anacrolix/dht/v2" _ "github.com/anacrolix/envpprof" "github.com/anacrolix/missinggo" "github.com/anacrolix/missinggo/filecache" + "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/internal/testutil" "github.com/anacrolix/torrent/iplist" diff --git a/cmd/magnet-metainfo/main.go b/cmd/magnet-metainfo/main.go index 889651371cb5d5e1f5bd175fe330e80b97cde215..536f7abff308df7cab39fcbe70418bb11333c798 100644 --- a/cmd/magnet-metainfo/main.go +++ b/cmd/magnet-metainfo/main.go @@ -9,6 +9,7 @@ "sync" _ "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 f28e6f430dc2f168c1b92a57f34a6e8f9202b4f7..d36dd0b5a9699cf884139f3567cf8e3f1f40caae 100644 --- a/cmd/torrent-create/main.go +++ b/cmd/torrent-create/main.go @@ -5,6 +5,7 @@ "log" "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 10a7bad930c9dbbd8fcb76f88957543fc395cbd8..81319c99a4692778462de66c58dd79826db7ee1b 100644 --- a/cmd/torrent-infohash/main.go +++ b/cmd/torrent-infohash/main.go @@ -5,6 +5,7 @@ "fmt" "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 3d4bf137da5503ff012d186bfb178ec2766e8708..7be1e4af7e64d7092873306f8a1d396b3b1d4842 100644 --- a/cmd/torrent-magnet/main.go +++ b/cmd/torrent-magnet/main.go @@ -5,6 +5,7 @@ "fmt" "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 73532ee3e223811911475e2c77b03f535ee73d27..9970b7b8094d24655d002ecb0cc3541b8f7ab440 100644 --- a/cmd/torrent-metainfo-pprint/main.go +++ b/cmd/torrent-metainfo-pprint/main.go @@ -11,8 +11,9 @@ "os" "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 07874e8af788590944a78a359975c515388c4f10..eada56876454a24bbe8db65da74623037eaa933c 100644 --- a/cmd/torrent-pick/main.go +++ b/cmd/torrent-pick/main.go @@ -15,10 +15,11 @@ "strings" "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 525cced890ca4e88ea58c5f856797278e71485bb..dfd14a7400aee1a629dc155bf1293bad81a79910 100644 --- a/cmd/torrent-verify/main.go +++ b/cmd/torrent-verify/main.go @@ -10,10 +10,11 @@ "os" "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 caac4855bb15a4d15b7027276a9625ebcd5b31af..8e86ae978bf7a9f897905e03465817f27deb0da7 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -15,13 +15,14 @@ "time" "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" + humanize "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" - humanize "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 5a02cec24be43a8cf5477e6a4abfbcaf293144ed..b2d34efe53b3ed45a365655d8a02744fb5fe1b29 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -17,6 +17,7 @@ "bazil.org/fuse" 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 4c029c39d18fba2722c6dfbda54e9d57d77d23c8..bfe12143e4a2cfe95a91bbf381dd31a600df3a17 100644 --- a/cmd/tracker-announce/main.go +++ b/cmd/tracker-announce/main.go @@ -9,6 +9,7 @@ "github.com/davecgh/go-spew/spew" "github.com/anacrolix/tagflag" + "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/metainfo" "github.com/anacrolix/torrent/tracker" diff --git a/config.go b/config.go index 9f0fdc3ffd9a98748d140d89776d014c29b295c3..f1131195a2b92c60413f0b95955e1af1a485a009 100644 --- a/config.go +++ b/config.go @@ -12,10 +12,11 @@ "github.com/anacrolix/log" "github.com/anacrolix/missinggo" "github.com/anacrolix/missinggo/conntrack" "github.com/anacrolix/missinggo/expect" + "golang.org/x/time/rate" + "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/mse" "github.com/anacrolix/torrent/storage" - "golang.org/x/time/rate" ) var DefaultHTTPUserAgent = "Go-Torrent/1.0" diff --git a/conn_stats.go b/conn_stats.go index 06ec23f2cb6eed31c149f65629180bb673bad82e..3a0216f587a6d8126d71f267b7c6c6f03e1f4ce4 100644 --- a/conn_stats.go +++ b/conn_stats.go @@ -1,11 +1,11 @@ package torrent import ( + "encoding/json" "fmt" "io" "reflect" "sync/atomic" - "encoding/json" pp "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/connection.go b/connection.go index 7fec0a43790175ac49ad7c783660936115ade8e0..397be949c00c3e6bb0b8163c38ab2623be85be42 100644 --- a/connection.go +++ b/connection.go @@ -19,10 +19,11 @@ "github.com/anacrolix/missinggo" "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 ffc482007f5d94d679d526be73084dc0391ef538..56a07f030918877f457f36c0a7972a87a16876a0 100644 --- a/connection_test.go +++ b/connection_test.go @@ -8,11 +8,12 @@ "testing" "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 48f3e5070ad1c8f7ed0c813080d63473afe12c8d..41517296b2a0680ff4e59b2c5d49b3607fd8fbc7 100644 --- a/fs/file_handle.go +++ b/fs/file_handle.go @@ -7,6 +7,7 @@ "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 b3f513f4b85ccba1bae8c88fd1c3e3624e3c2e85..a7c807b4fe897d0f50d2c649cb6566f66706cd7b 100644 --- a/fs/filenode.go +++ b/fs/filenode.go @@ -5,6 +5,7 @@ "context" "bazil.org/fuse" fusefs "bazil.org/fuse/fs" + "github.com/anacrolix/torrent" ) diff --git a/fs/torrentfs.go b/fs/torrentfs.go index 47dfffc0a08caaf3caefadf57f51d29428afc3eb..843e2f16eb0c3976f27374639bc355ffb6fa10b4 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -9,6 +9,7 @@ "sync" "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 55fd7c97ccc647cba7b3dca23206184a5f961b1f..3c152cbf93257d372b5883b1ec78442aaef96318 100644 --- a/fs/torrentfs_test.go +++ b/fs/torrentfs_test.go @@ -17,12 +17,13 @@ "bazil.org/fuse" 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 90accb4052ecf51a63cf78dc0862fac3d25d1eed..b2daa48bcbe7293a8bbb22d879a376e80d8c9a48 100644 --- a/internal/testutil/spec.go +++ b/internal/testutil/spec.go @@ -6,6 +6,7 @@ "io/ioutil" "strings" "github.com/anacrolix/missinggo/expect" + "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/metainfo" ) diff --git a/iplist/cmd/iplist/main.go b/iplist/cmd/iplist/main.go index b46ce215e7d71c0282385e1351052721d503836e..d7bfbeef4811c5f866b26c3f62806201f842170a 100644 --- a/iplist/cmd/iplist/main.go +++ b/iplist/cmd/iplist/main.go @@ -7,6 +7,7 @@ "net" "os" "github.com/anacrolix/tagflag" + "github.com/anacrolix/torrent/iplist" ) diff --git a/iplist/cmd/pack-blocklist/main.go b/iplist/cmd/pack-blocklist/main.go index 6ca81e054b5f2d7d4f7cc4c9f3ebbb615d178e59..037ceeba73e971e831c652f1fc91d391dea9de04 100644 --- a/iplist/cmd/pack-blocklist/main.go +++ b/iplist/cmd/pack-blocklist/main.go @@ -8,6 +8,7 @@ "os" "github.com/anacrolix/missinggo" "github.com/anacrolix/tagflag" + "github.com/anacrolix/torrent/iplist" ) diff --git a/issue211_test.go b/issue211_test.go index c12a9c9e303714a81de7d603cbe0cd6af978b336..dedbaa5647a80a1337f94e10a7ef3aa38a2852b1 100644 --- a/issue211_test.go +++ b/issue211_test.go @@ -5,11 +5,12 @@ "io" "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 5f36e67f68808927d9922f2efa21335917712148..5ccfa62e6a9d00f4a99d3f6a6d2c693115866e12 100644 --- a/issue97_test.go +++ b/issue97_test.go @@ -5,9 +5,10 @@ "io/ioutil" "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 603fe8007a57b1afc912c77edef6ee5669f91441..d65ac2f1ccade07c615a24e395ef7a2fe2f6fab2 100644 --- a/metainfo/info_test.go +++ b/metainfo/info_test.go @@ -3,8 +3,9 @@ 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 5521f919a159cbf57e4967927af76a6a1efc45a3..e54447ae5aadeebffb25a50171f5885dd15a1e24 100644 --- a/metainfo/metainfo_test.go +++ b/metainfo/metainfo_test.go @@ -9,9 +9,10 @@ "path/filepath" "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 3e54b961ce352f8adaa45fcfdfba32de42e075f8..adebbb3670371b2f96de91e61de6a76fe82a5fd2 100644 --- a/metainfo/nodes_test.go +++ b/metainfo/nodes_test.go @@ -4,9 +4,10 @@ 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 7e73e723393252d20b474661fc2e2d295d593b24..bdf531894157f5ecdb24dcfb5b2bf752b1f8b220 100644 --- a/misc.go +++ b/misc.go @@ -5,9 +5,10 @@ "errors" "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 d165f7a0e726cdf07db03161929e77f16b9d7702..09d9343e9be32b85ff01aa242b209486ede7f76d 100644 --- a/peer_protocol/handshake.go +++ b/peer_protocol/handshake.go @@ -8,6 +8,7 @@ "golang.org/x/xerrors" "github.com/anacrolix/missinggo" + "github.com/anacrolix/torrent/metainfo" ) diff --git a/peer_protocol/pex_test.go b/peer_protocol/pex_test.go index 19cd66bfd8372115c3b43f9aa1ae28d82bd2e98f..0c2b9f9ed1489008984571bd09502da3902033b0 100644 --- a/peer_protocol/pex_test.go +++ b/peer_protocol/pex_test.go @@ -3,8 +3,9 @@ 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/reader_test.go b/reader_test.go index c8ea81d8247497a27a061ec1c54694f30a2d580b..86021dd60ae8c6bfff8af2a93c04ec7d49014483 100644 --- a/reader_test.go +++ b/reader_test.go @@ -5,8 +5,9 @@ "context" "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 f0e21dc1efc64ed66bc4807d9e137aace0d305a5..d0accb1df7da225184616b8cd1d68541adeb86b6 100644 --- a/storage/boltPieceCompletion.go +++ b/storage/boltPieceCompletion.go @@ -6,8 +6,9 @@ "os" "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 a9e22bba3bbabc61d15533fce38d78104912cff4..35120e0e1f52402eb2a295dd5ea9925ec40f08ce 100644 --- a/storage/bolt_piece.go +++ b/storage/bolt_piece.go @@ -4,8 +4,9 @@ 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 30f38c651dece2426d44efa75379d5ad79045963..56c711ffee5edd34f6ac6e4a7759507a421e8da3 100644 --- a/storage/boltdb.go +++ b/storage/boltdb.go @@ -6,8 +6,9 @@ "path/filepath" "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 cce7c9109d80b2ed4a0b50920a0dae99db7bb3ec..53fdbdb590a27a7e26c8c233779e7b10a7ae8acc 100644 --- a/storage/boltpc_test.go +++ b/storage/boltpc_test.go @@ -5,9 +5,10 @@ "io/ioutil" "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 d01b53af26b685bd7b96af9672c30d6737580790..fd4d56014f6cb230529ddecc82e26108411eac7f 100644 --- a/storage/file.go +++ b/storage/file.go @@ -6,6 +6,7 @@ "os" "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 9c6463450a606cc40987f47b7e166d60814b0a1a..8b453045c1d813282d74ee7d2a7a5fede5127c4a 100644 --- a/storage/file_misc_test.go +++ b/storage/file_misc_test.go @@ -3,8 +3,9 @@ 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 719b98f2b28883690c8026ac21d5b0f829fefa82..1a5e1b606d7df3b579f57424720927d2296abf05 100644 --- a/storage/file_test.go +++ b/storage/file_test.go @@ -9,9 +9,10 @@ "path/filepath" "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 9043eb4e7ddd0643aed3e32bae5229965a6edbda..d47410dae3c287c56c9b2d6bb66a4f309f75cc3a 100644 --- a/storage/issue95_test.go +++ b/storage/issue95_test.go @@ -6,9 +6,10 @@ "os" "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 21158f99efa393e37c52fe0ebae4abb92ee5c06d..1bdbbf15cb73e7bde6fb701c0e3347b527e14def 100644 --- a/storage/issue96_test.go +++ b/storage/issue96_test.go @@ -5,8 +5,9 @@ "io/ioutil" "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 53455467742f492ef168ec9b8afe9bbdee5f4693..8bce4dc778827acea4096c57ff5dc37e479d1750 100644 --- a/storage/mmap.go +++ b/storage/mmap.go @@ -8,9 +8,10 @@ "os" "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 8f6f9063b42129fd2e6281700524f067a538e8fa..1064fae557e9c4559a13253c751810c13f1b839b 100644 --- a/storage/piece_resource.go +++ b/storage/piece_resource.go @@ -4,6 +4,7 @@ import ( "path" "github.com/anacrolix/missinggo/resource" + "github.com/anacrolix/torrent/metainfo" ) diff --git a/storage/sqlitePieceCompletion.go b/storage/sqlitePieceCompletion.go index 5a859d2325ef6a0257dd699e65265696c283a0d2..508b4fa49ae90015a6e8cdd9dd54f949478ba7b7 100644 --- a/storage/sqlitePieceCompletion.go +++ b/storage/sqlitePieceCompletion.go @@ -6,8 +6,9 @@ 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 c706e8dc850b46b05187ddc672cc62124abbbf0f..4fc0e10d6208445ac2be8332964e9ee57381ca1b 100644 --- a/storage/wrappers.go +++ b/storage/wrappers.go @@ -5,6 +5,7 @@ "io" "os" "github.com/anacrolix/missinggo" + "github.com/anacrolix/torrent/metainfo" ) diff --git a/t.go b/t.go index cd8bc10cd88b9e9be2bcad880756005fdf515af4..6b553f96e34ec88593ac12cb119fc7104dc03db3 100644 --- a/t.go +++ b/t.go @@ -5,6 +5,7 @@ "strconv" "strings" "github.com/anacrolix/missinggo/pubsub" + "github.com/anacrolix/torrent/metainfo" ) diff --git a/torrent.go b/torrent.go index d865ac605a955549d75701941c7cd3c2ef773ed2..70c8d42046f340944761efeca1b3bdadd179df4b 100644 --- a/torrent.go +++ b/torrent.go @@ -24,6 +24,7 @@ "github.com/anacrolix/missinggo/perf" "github.com/anacrolix/missinggo/prioritybitmap" "github.com/anacrolix/missinggo/pubsub" "github.com/anacrolix/missinggo/slices" + "github.com/anacrolix/torrent/bencode" "github.com/anacrolix/torrent/metainfo" pp "github.com/anacrolix/torrent/peer_protocol" diff --git a/torrent_test.go b/torrent_test.go index 300929d3270110eb38d60bbef2bbbc2ccc09906c..9502b57e741b216cfd17f708ab7c45e2076d5fc9 100644 --- a/torrent_test.go +++ b/torrent_test.go @@ -8,14 +8,15 @@ "path/filepath" "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 ee365de7177ccce29a43370db52b2f483f247b89..11f88d64a557fe82164f61c0c29a731767c0cf94 100644 --- a/tracker/http.go +++ b/tracker/http.go @@ -14,6 +14,7 @@ "time" "github.com/anacrolix/dht/v2/krpc" "github.com/anacrolix/missinggo/httptoo" + "github.com/anacrolix/torrent/bencode" ) diff --git a/tracker/http_test.go b/tracker/http_test.go index 1defeb8526aeee08ece2b25cc5d858a3ca72f528..c90a35ef5e11b362dab3afad799f994472e95cb2 100644 --- a/tracker/http_test.go +++ b/tracker/http_test.go @@ -3,9 +3,10 @@ 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 2c64390a60bbc190f726c2f901c879883a085d60..728365dedfadd2bd2c91f4a7af3d15e74433971a 100644 --- a/tracker_scraper.go +++ b/tracker_scraper.go @@ -9,6 +9,7 @@ "net/url" "time" "github.com/anacrolix/dht/v2/krpc" + "github.com/anacrolix/torrent/tracker" ) diff --git a/util/dirwatch/dirwatch.go b/util/dirwatch/dirwatch.go index 3f784a73e74bbedd063d17e9109a70284959dfda..018d3f42a2a8815e3930df94257d2a7e9cec631b 100644 --- a/util/dirwatch/dirwatch.go +++ b/util/dirwatch/dirwatch.go @@ -10,8 +10,9 @@ "path/filepath" "strings" "github.com/anacrolix/missinggo" + "github.com/fsnotify/fsnotify" + "github.com/anacrolix/torrent/metainfo" - "github.com/fsnotify/fsnotify" ) type Change uint