client.go | 2 +- internal/cmd/issue-906/main.go | 1 + ltep.go | 1 + ltep_test.go | 9 +++------ peer_protocol/reserved_test.go | 3 ++- peerconn_test.go | 2 +- request-strategy/piece-request-order.go | 1 + smartban/smartban.go | 3 ++- smartban_test.go | 8 +++++--- socket.go | 2 +- storage/piece-resource.go | 2 +- storage/possum/possum-provider.go | 8 +++++--- storage/possum/possum_test.go | 4 +++- torrent-piece-request-order.go | 1 + diff --git a/client.go b/client.go index e2f1de31aa032061c14c1b6b23cc5ea287842c89..938bd5f30649b9ed5da7ff702da118dc1d325bcc 100644 --- a/client.go +++ b/client.go @@ -9,7 +9,6 @@ "encoding/hex" "errors" "expvar" "fmt" - "github.com/cespare/xxhash" "io" "math" "net" @@ -31,6 +30,7 @@ "github.com/anacrolix/missinggo/v2" "github.com/anacrolix/missinggo/v2/bitmap" "github.com/anacrolix/missinggo/v2/pproffd" "github.com/anacrolix/sync" + "github.com/cespare/xxhash" "github.com/davecgh/go-spew/spew" "github.com/dustin/go-humanize" gbtree "github.com/google/btree" diff --git a/internal/cmd/issue-906/main.go b/internal/cmd/issue-906/main.go index 7c3bdc1780337bbb7765292e1c2c476d93cae23b..41c8c58426b7fc26d572c56ab6fcd936606f5493 100644 --- a/internal/cmd/issue-906/main.go +++ b/internal/cmd/issue-906/main.go @@ -6,6 +6,7 @@ "net/http" "os" _ "github.com/anacrolix/envpprof" + "github.com/anacrolix/torrent" ) diff --git a/ltep.go b/ltep.go index 747d8086fb6ed6cececdd4707eb70673340cd06e..cde0378413cecd290cd8890f3b47c47cc1bf299a 100644 --- a/ltep.go +++ b/ltep.go @@ -5,6 +5,7 @@ "fmt" "slices" g "github.com/anacrolix/generics" + pp "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/ltep_test.go b/ltep_test.go index c3c874ceca28e8e19511c4a440c6a1c4c28afa96..0a95a86837853d0b8f088d958dfb28ed1e83d6ca 100644 --- a/ltep_test.go +++ b/ltep_test.go @@ -4,15 +4,12 @@ import ( "strconv" "testing" - pp "github.com/anacrolix/torrent/peer_protocol" - + "github.com/anacrolix/sync" qt "github.com/frankban/quicktest" + . "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/internal/testutil" - - "github.com/anacrolix/sync" - - . "github.com/anacrolix/torrent" + pp "github.com/anacrolix/torrent/peer_protocol" ) const ( diff --git a/peer_protocol/reserved_test.go b/peer_protocol/reserved_test.go index 8ee3a722779c15cd1ace08eb6fe5fd140c770c62..53f9d86d92af00f7cfd726115c3b78b6070b0d3c 100644 --- a/peer_protocol/reserved_test.go +++ b/peer_protocol/reserved_test.go @@ -1,8 +1,9 @@ package peer_protocol import ( + "testing" + qt "github.com/frankban/quicktest" - "testing" ) func TestV2BitLocation(t *testing.T) { diff --git a/peerconn_test.go b/peerconn_test.go index 36327800164388946d1dbcf990754b6d095c41ee..70f9017bb09227e8c7880b033aab586d3dd445df 100644 --- a/peerconn_test.go +++ b/peerconn_test.go @@ -4,13 +4,13 @@ import ( "encoding/binary" "errors" "fmt" - g "github.com/anacrolix/generics" "io" "net" "net/netip" "sync" "testing" + g "github.com/anacrolix/generics" "github.com/frankban/quicktest" qt "github.com/frankban/quicktest" "github.com/stretchr/testify/require" diff --git a/request-strategy/piece-request-order.go b/request-strategy/piece-request-order.go index 54b5a6ee995ffc7dce73cf930bcc8c4613d16e64..0e2797726a5bd820d30a40c961f29b57ddb51567 100644 --- a/request-strategy/piece-request-order.go +++ b/request-strategy/piece-request-order.go @@ -2,6 +2,7 @@ package requestStrategy import ( g "github.com/anacrolix/generics" + "github.com/anacrolix/torrent/metainfo" ) diff --git a/smartban/smartban.go b/smartban/smartban.go index ba568c98d041b4eb38408f69f4c77cc398bbe889..1910d7d5a2ff4027160cebafb586eeded4e94542 100644 --- a/smartban/smartban.go +++ b/smartban/smartban.go @@ -1,8 +1,9 @@ package smartban import ( + "sync" + g "github.com/anacrolix/generics" - "sync" ) type Cache[Peer, BlockKey, Hash comparable] struct { diff --git a/smartban_test.go b/smartban_test.go index 2947f521697fb34fea867f3b8017615b3582dc7b..0f8e8d917a60f6463450ee8b4dc2e814d12ad23c 100644 --- a/smartban_test.go +++ b/smartban_test.go @@ -2,11 +2,13 @@ package torrent import ( "crypto/sha1" - "github.com/anacrolix/missinggo/v2/iter" - "github.com/anacrolix/torrent/smartban" - "github.com/cespare/xxhash" "net/netip" "testing" + + "github.com/anacrolix/missinggo/v2/iter" + "github.com/cespare/xxhash" + + "github.com/anacrolix/torrent/smartban" ) func benchmarkSmartBanRecordBlock[Sum comparable](b *testing.B, hash func([]byte) Sum) { diff --git a/socket.go b/socket.go index 0f45dcbae796a5bbb21d2945d6ce25edd4116af1..18c8b86034f1a482cc8fdee49368614d834de106 100644 --- a/socket.go +++ b/socket.go @@ -4,12 +4,12 @@ import ( "context" "errors" "fmt" - g "github.com/anacrolix/generics" "net" "os" "strconv" "syscall" + g "github.com/anacrolix/generics" "github.com/anacrolix/log" "github.com/anacrolix/missinggo/perf" "github.com/anacrolix/missinggo/v2" diff --git a/storage/piece-resource.go b/storage/piece-resource.go index a891e9d246af0e0b94dc610e87229830ca47a424..9e3e63e7fa6bd75c004ed630acb7a9ee18ca1fa6 100644 --- a/storage/piece-resource.go +++ b/storage/piece-resource.go @@ -3,13 +3,13 @@ import ( "bytes" "fmt" - "github.com/anacrolix/sync" "io" "path" "sort" "strconv" "github.com/anacrolix/missinggo/v2/resource" + "github.com/anacrolix/sync" "github.com/anacrolix/torrent/metainfo" ) diff --git a/storage/possum/possum-provider.go b/storage/possum/possum-provider.go index e67cdada48b134bf3d86ff314e51b3d3992d9ca4..fd7810d317e35f054414a4762ef7725255a622a8 100644 --- a/storage/possum/possum-provider.go +++ b/storage/possum/possum-provider.go @@ -5,13 +5,15 @@ import ( "cmp" "fmt" + "io" + "sort" + "strconv" + "github.com/anacrolix/log" possum "github.com/anacrolix/possum/go" possumResource "github.com/anacrolix/possum/go/resource" + "github.com/anacrolix/torrent/storage" - "io" - "sort" - "strconv" ) // Extends possum resource.Provider with an efficient implementation of torrent diff --git a/storage/possum/possum_test.go b/storage/possum/possum_test.go index 6bd350b1dc5866d3c368335ee0dda59ba8be715c..1c0e81105db25851e47c43649495e2e397569337 100644 --- a/storage/possum/possum_test.go +++ b/storage/possum/possum_test.go @@ -1,13 +1,15 @@ package possumTorrentStorage import ( + "testing" + g "github.com/anacrolix/generics" "github.com/anacrolix/log" possum "github.com/anacrolix/possum/go" possumResource "github.com/anacrolix/possum/go/resource" + "github.com/anacrolix/torrent/storage" test_storage "github.com/anacrolix/torrent/storage/test" - "testing" ) // This should be made to mirror the benchmarks for sqlite storage. diff --git a/torrent-piece-request-order.go b/torrent-piece-request-order.go index 03943ed04a1d71445925d82584afafa353d32484..b2bde8dc9e9cd4236462db3652bcc3ae3c247e52 100644 --- a/torrent-piece-request-order.go +++ b/torrent-piece-request-order.go @@ -2,6 +2,7 @@ package torrent import ( g "github.com/anacrolix/generics" + request_strategy "github.com/anacrolix/torrent/request-strategy" )