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 +-- diff --git a/Peer.go b/Peer.go index a51d86c07975179fedc4813ff7fb5743fa97075f..e4a7a2fb4cfcd6695b79d9567cf921a16b1680ef 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 9c3e062cfa0ccde78e10897d02d759bb3a8ad99c..5d88bb3e50bbe60330d122a6c8b4d915d123a2a3 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 c60bf17abdfce9bace95a485821a13457fbc5fa5..03488999f756d92524e5cb2b7d3f8926194949b8 100644 --- a/bencode/decode.go +++ b/bencode/decode.go @@ -243,9 +243,9 @@ Field: sf.r, }) } 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 ca4041cf2ea25c03608d7ed27d5c7510c75907e9..0b12128f6e2a329c554edd3bb58dc65ed357fe08 100644 --- a/client_test.go +++ b/client_test.go @@ -16,16 +16,15 @@ "github.com/anacrolix/dht" _ "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 536f7abff308df7cab39fcbe70418bb11333c798..889651371cb5d5e1f5bd175fe330e80b97cde215 100644 --- a/cmd/magnet-metainfo/main.go +++ b/cmd/magnet-metainfo/main.go @@ -9,7 +9,6 @@ "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 4a429e9bcaeb7c7ace434b617e53b4b00250ae25..d62f8fd5d01210e3aea440943c03b3136fef7d30 100644 --- a/cmd/torrent-create/main.go +++ b/cmd/torrent-create/main.go @@ -5,7 +5,6 @@ "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 81319c99a4692778462de66c58dd79826db7ee1b..10a7bad930c9dbbd8fcb76f88957543fc395cbd8 100644 --- a/cmd/torrent-infohash/main.go +++ b/cmd/torrent-infohash/main.go @@ -5,7 +5,6 @@ "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 ee0ea2ec2b7b020eda6fd8ac67e12e9f2cd2ac06..a1d530779ddd32eec3bbd90a3775b64160501660 100644 --- a/cmd/torrent-magnet/main.go +++ b/cmd/torrent-magnet/main.go @@ -5,7 +5,6 @@ "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 52c6c1069ec323002d974dd07d21eabe797c698a..ec78facf47cc4e3520827fae09a8a1834760726a 100644 --- a/cmd/torrent-metainfo-pprint/main.go +++ b/cmd/torrent-metainfo-pprint/main.go @@ -11,9 +11,8 @@ "os" "github.com/anacrolix/envpprof" "github.com/anacrolix/tagflag" + "github.com/anacrolix/torrent/metainfo" "github.com/bradfitz/iter" - - "github.com/anacrolix/torrent/metainfo" ) var flags struct { diff --git a/cmd/torrent-pick/main.go b/cmd/torrent-pick/main.go index eada56876454a24bbe8db65da74623037eaa933c..07874e8af788590944a78a359975c515388c4f10 100644 --- a/cmd/torrent-pick/main.go +++ b/cmd/torrent-pick/main.go @@ -15,11 +15,10 @@ "strings" "time" _ "github.com/anacrolix/envpprof" + "github.com/anacrolix/torrent" + "github.com/anacrolix/torrent/metainfo" "github.com/dustin/go-humanize" "github.com/jessevdk/go-flags" - - "github.com/anacrolix/torrent" - "github.com/anacrolix/torrent/metainfo" ) // 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 dfd14a7400aee1a629dc155bf1293bad81a79910..525cced890ca4e88ea58c5f856797278e71485bb 100644 --- a/cmd/torrent-verify/main.go +++ b/cmd/torrent-verify/main.go @@ -10,11 +10,10 @@ "os" "path/filepath" "github.com/anacrolix/tagflag" + "github.com/anacrolix/torrent/metainfo" + "github.com/anacrolix/torrent/mmap_span" "github.com/bradfitz/iter" "github.com/edsrzf/mmap-go" - - "github.com/anacrolix/torrent/metainfo" - "github.com/anacrolix/torrent/mmap_span" ) func mmapFile(name string) (mm mmap.MMap, err error) { diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index abbb5521fd64a3fc0f331c561c5dbd494699cfcf..2cdf886ecfc56bea8c4de41aff4a4ef645765349 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -15,14 +15,13 @@ "time" "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 b2d34efe53b3ed45a365655d8a02744fb5fe1b29..5a02cec24be43a8cf5477e6a4abfbcaf293144ed 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -17,7 +17,6 @@ "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 e038d872b9ca09b661c9ff2fe1d85042cd9486fa..f2eb02e419708bf8029af9924e96554aa49f957a 100644 --- a/cmd/tracker-announce/main.go +++ b/cmd/tracker-announce/main.go @@ -8,11 +8,10 @@ "strings" "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 964453af536c78176fe89ce55edbcf8dbc265bf6..31f2251387f796cdf7ff54d9d731311ec48a45ad 100644 --- a/config.go +++ b/config.go @@ -9,10 +9,9 @@ "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 d0446e112315b4a1d9787be8a933caf1d21ffcd6..f58fca217ef2349ce8dc5e245619cf24ac7312ad 100644 --- a/connection.go +++ b/connection.go @@ -19,11 +19,10 @@ "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 949c55f44ecc8cb82a3b825a8627bfc2c7224b81..673b5e514a48c65d7aca9a8bb9db6c43a6b1a7e4 100644 --- a/connection_test.go +++ b/connection_test.go @@ -8,12 +8,11 @@ "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 41517296b2a0680ff4e59b2c5d49b3607fd8fbc7..48f3e5070ad1c8f7ed0c813080d63473afe12c8d 100644 --- a/fs/file_handle.go +++ b/fs/file_handle.go @@ -7,7 +7,6 @@ "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 a7c807b4fe897d0f50d2c649cb6566f66706cd7b..b3f513f4b85ccba1bae8c88fd1c3e3624e3c2e85 100644 --- a/fs/filenode.go +++ b/fs/filenode.go @@ -5,7 +5,6 @@ "context" "bazil.org/fuse" fusefs "bazil.org/fuse/fs" - "github.com/anacrolix/torrent" ) diff --git a/fs/torrentfs.go b/fs/torrentfs.go index e143eca2e15c90a9b128ff633922739221e2dc08..8e3e6898c3a0e7085f35e9268a46ac925d8d0af7 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -9,7 +9,6 @@ "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 716ea5f81fa2337adc4b93d86a402a3d96c41c81..4a37a351928d51aa0368004e641f073f2c5d8531 100644 --- a/fs/torrentfs_test.go +++ b/fs/torrentfs_test.go @@ -17,13 +17,12 @@ "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 b2daa48bcbe7293a8bbb22d879a376e80d8c9a48..90accb4052ecf51a63cf78dc0862fac3d25d1eed 100644 --- a/internal/testutil/spec.go +++ b/internal/testutil/spec.go @@ -6,7 +6,6 @@ "io/ioutil" "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 037ceeba73e971e831c652f1fc91d391dea9de04..6ca81e054b5f2d7d4f7cc4c9f3ebbb615d178e59 100644 --- a/iplist/cmd/pack-blocklist/main.go +++ b/iplist/cmd/pack-blocklist/main.go @@ -8,7 +8,6 @@ "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 dedbaa5647a80a1337f94e10a7ef3aa38a2852b1..c12a9c9e303714a81de7d603cbe0cd6af978b336 100644 --- a/issue211_test.go +++ b/issue211_test.go @@ -5,12 +5,11 @@ "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 5ccfa62e6a9d00f4a99d3f6a6d2c693115866e12..5f36e67f68808927d9922f2efa21335917712148 100644 --- a/issue97_test.go +++ b/issue97_test.go @@ -5,10 +5,9 @@ "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 cf1eaf8f0f5ec2b78f0951374ba1c7662edb12ef..bf2b9a1eab4d0ec2101f545b08b69d73c3e538b4 100644 --- a/metainfo/info_test.go +++ b/metainfo/info_test.go @@ -3,9 +3,8 @@ import ( "testing" + "github.com/anacrolix/torrent/bencode" "github.com/stretchr/testify/assert" - - "github.com/anacrolix/torrent/bencode" ) func TestMarshalInfo(t *testing.T) { diff --git a/metainfo/metainfo_test.go b/metainfo/metainfo_test.go index e54447ae5aadeebffb25a50171f5885dd15a1e24..5521f919a159cbf57e4967927af76a6a1efc45a3 100644 --- a/metainfo/metainfo_test.go +++ b/metainfo/metainfo_test.go @@ -9,10 +9,9 @@ "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 adebbb3670371b2f96de91e61de6a76fe82a5fd2..3e54b961ce352f8adaa45fcfdfba32de42e075f8 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 5f7f66bef278e82479147e8b0fb62ee5cce71a0d..9d0943833ee5cc30d13ca913f51f54f2bd0eebce 100644 --- a/misc.go +++ b/misc.go @@ -5,10 +5,9 @@ "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 e3389171d84a4c44ea87f8d7700f4d2233a41b0b..fe232948b562a1898dfcf14d5212411af5a98ef3 100644 --- a/peer_protocol/handshake.go +++ b/peer_protocol/handshake.go @@ -6,7 +6,6 @@ "fmt" "io" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/metainfo" ) @@ -123,7 +122,7 @@ } 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 054c32beb9f6e79ff2d5ad04760ffeefff53925f..59a17c87f42b5d6620056d48a8880241b3e53e72 100644 --- a/peer_protocol/pex_test.go +++ b/peer_protocol/pex_test.go @@ -3,9 +3,8 @@ import ( "testing" + "github.com/anacrolix/torrent/bencode" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/bencode" ) func TestUnmarshalPex(t *testing.T) { diff --git a/piece.go b/piece.go index 6eef0cc13b199b37df647bb9bed5042fef01a3bb..e580754df63cef2037eba8539a66ce87106e2120 100644 --- a/piece.go +++ b/piece.go @@ -5,7 +5,6 @@ "fmt" "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 71ddd480c8daa49683d40d41ac5b39a913653efa..07eefc87db05e67dccc952f24f245e9dc81966aa 100644 --- a/reader.go +++ b/reader.go @@ -8,7 +8,6 @@ "log" "sync" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/reader_test.go b/reader_test.go index 86021dd60ae8c6bfff8af2a93c04ec7d49014483..c8ea81d8247497a27a061ec1c54694f30a2d580b 100644 --- a/reader_test.go +++ b/reader_test.go @@ -5,9 +5,8 @@ "context" "testing" "time" + "github.com/anacrolix/torrent/internal/testutil" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/internal/testutil" ) func TestReaderReadContext(t *testing.T) { diff --git a/storage/boltPieceCompletion.go b/storage/boltPieceCompletion.go index d0accb1df7da225184616b8cd1d68541adeb86b6..f0e21dc1efc64ed66bc4807d9e137aace0d305a5 100644 --- a/storage/boltPieceCompletion.go +++ b/storage/boltPieceCompletion.go @@ -6,9 +6,8 @@ "os" "path/filepath" "time" + "github.com/anacrolix/torrent/metainfo" "github.com/boltdb/bolt" - - "github.com/anacrolix/torrent/metainfo" ) const ( diff --git a/storage/bolt_piece.go b/storage/bolt_piece.go index 35120e0e1f52402eb2a295dd5ea9925ec40f08ce..a9e22bba3bbabc61d15533fce38d78104912cff4 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/anacrolix/torrent/metainfo" "github.com/boltdb/bolt" - - "github.com/anacrolix/torrent/metainfo" ) type boltDBPiece struct { diff --git a/storage/boltdb.go b/storage/boltdb.go index 56c711ffee5edd34f6ac6e4a7759507a421e8da3..30f38c651dece2426d44efa75379d5ad79045963 100644 --- a/storage/boltdb.go +++ b/storage/boltdb.go @@ -6,9 +6,8 @@ "path/filepath" "time" "github.com/anacrolix/missinggo/expect" + "github.com/anacrolix/torrent/metainfo" "github.com/boltdb/bolt" - - "github.com/anacrolix/torrent/metainfo" ) const ( diff --git a/storage/boltpc_test.go b/storage/boltpc_test.go index 53fdbdb590a27a7e26c8c233779e7b10a7ae8acc..cce7c9109d80b2ed4a0b50920a0dae99db7bb3ec 100644 --- a/storage/boltpc_test.go +++ b/storage/boltpc_test.go @@ -5,10 +5,9 @@ "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 fd4d56014f6cb230529ddecc82e26108411eac7f..d01b53af26b685bd7b96af9672c30d6737580790 100644 --- a/storage/file.go +++ b/storage/file.go @@ -6,7 +6,6 @@ "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 8b453045c1d813282d74ee7d2a7a5fede5127c4a..9c6463450a606cc40987f47b7e166d60814b0a1a 100644 --- a/storage/file_misc_test.go +++ b/storage/file_misc_test.go @@ -3,9 +3,8 @@ import ( "testing" + "github.com/anacrolix/torrent/metainfo" "github.com/stretchr/testify/assert" - - "github.com/anacrolix/torrent/metainfo" ) func TestExtentCompleteRequiredLengths(t *testing.T) { diff --git a/storage/file_test.go b/storage/file_test.go index 1a5e1b606d7df3b579f57424720927d2296abf05..719b98f2b28883690c8026ac21d5b0f829fefa82 100644 --- a/storage/file_test.go +++ b/storage/file_test.go @@ -9,10 +9,9 @@ "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 d47410dae3c287c56c9b2d6bb66a4f309f75cc3a..9043eb4e7ddd0643aed3e32bae5229965a6edbda 100644 --- a/storage/issue95_test.go +++ b/storage/issue95_test.go @@ -6,10 +6,9 @@ "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 1bdbbf15cb73e7bde6fb701c0e3347b527e14def..21158f99efa393e37c52fe0ebae4abb92ee5c06d 100644 --- a/storage/issue96_test.go +++ b/storage/issue96_test.go @@ -5,9 +5,8 @@ "io/ioutil" "os" "testing" + "github.com/anacrolix/torrent/metainfo" "github.com/stretchr/testify/require" - - "github.com/anacrolix/torrent/metainfo" ) func testMarkedCompleteMissingOnRead(t *testing.T, csf func(string) ClientImpl) { diff --git a/storage/mmap.go b/storage/mmap.go index 8bce4dc778827acea4096c57ff5dc37e479d1750..53455467742f492ef168ec9b8afe9bbdee5f4693 100644 --- a/storage/mmap.go +++ b/storage/mmap.go @@ -8,10 +8,9 @@ "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 1064fae557e9c4559a13253c751810c13f1b839b..8f6f9063b42129fd2e6281700524f067a538e8fa 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 508b4fa49ae90015a6e8cdd9dd54f949478ba7b7..5a859d2325ef6a0257dd699e65265696c283a0d2 100644 --- a/storage/sqlitePieceCompletion.go +++ b/storage/sqlitePieceCompletion.go @@ -6,9 +6,8 @@ import ( "database/sql" "path/filepath" + "github.com/anacrolix/torrent/metainfo" _ "github.com/mattn/go-sqlite3" - - "github.com/anacrolix/torrent/metainfo" ) type sqlitePieceCompletion struct { diff --git a/storage/wrappers.go b/storage/wrappers.go index 4fc0e10d6208445ac2be8332964e9ee57381ca1b..c706e8dc850b46b05187ddc672cc62124abbbf0f 100644 --- a/storage/wrappers.go +++ b/storage/wrappers.go @@ -5,7 +5,6 @@ "io" "os" "github.com/anacrolix/missinggo" - "github.com/anacrolix/torrent/metainfo" ) diff --git a/t.go b/t.go index c66935c20c11a2ad6253b63d78de480db8c50eeb..043262066fe8a73b4d30e8f7c2a2ed14b065ab1a 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 0b13fe257608753b4581e3962c35fabc8c70d5b7..9400bf281d52b455aa2bfa11e4a056e8d80f6fa2 100644 --- a/torrent.go +++ b/torrent.go @@ -24,13 +24,12 @@ "github.com/anacrolix/missinggo/perf" "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 22053794368c87b888657fefee096919ca735505..22646ef2005ed391084b7965be8e6ff3b704e3e6 100644 --- a/torrent_test.go +++ b/torrent_test.go @@ -8,15 +8,14 @@ "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 58d9dc1144585b0f3b00dcce7e806a68b9932b7a..69764040d8996a51587872ff6eabe145143f6b12 100644 --- a/tracker/http.go +++ b/tracker/http.go @@ -13,7 +13,6 @@ "time" "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 c90a35ef5e11b362dab3afad799f994472e95cb2..1defeb8526aeee08ece2b25cc5d858a3ca72f528 100644 --- a/tracker/http_test.go +++ b/tracker/http_test.go @@ -3,10 +3,9 @@ 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 0a87c868662ca464f9df98b483c91f61623c1426..5f31a0197f40a9a8d10fe7bdedab63d577908856 100644 --- a/tracker_scraper.go +++ b/tracker_scraper.go @@ -10,7 +10,6 @@ "time" "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 018d3f42a2a8815e3930df94257d2a7e9cec631b..3f784a73e74bbedd063d17e9109a70284959dfda 100644 --- a/util/dirwatch/dirwatch.go +++ b/util/dirwatch/dirwatch.go @@ -10,9 +10,8 @@ "path/filepath" "strings" "github.com/anacrolix/missinggo" + "github.com/anacrolix/torrent/metainfo" "github.com/fsnotify/fsnotify" - - "github.com/anacrolix/torrent/metainfo" ) type Change uint