From 3aa78763aad1e90c33500c0313efa05d8b36518e Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 26 Mar 2015 17:18:08 +1100 Subject: [PATCH] Use rogpeppe's sortimports to fix this goimports ordering madness --- client.go | 9 ++++----- client_test.go | 7 +++---- cmd/torrent-verify/main.go | 3 ++- cmd/torrent/main.go | 7 ++----- cmd/torrentfs/main.go | 7 +++---- connection.go | 2 ++ connection_test.go | 4 +--- data/blob/store.go | 3 ++- data/mmap/mmap.go | 3 ++- dht/dht.go | 5 +++-- dht/getpeers.go | 6 +++--- fs/torrentfs.go | 4 ++-- fs/torrentfs_test.go | 11 ++++------- mse/mse.go | 4 ++-- mse/mse_test.go | 3 +-- torrent.go | 4 ++-- util/dirwatch/dirwatch.go | 5 +++-- 17 files changed, 41 insertions(+), 46 deletions(-) diff --git a/client.go b/client.go index 50fe4691..5c49565c 100644 --- a/client.go +++ b/client.go @@ -38,24 +38,23 @@ import ( "syscall" "time" - "github.com/bradfitz/iter" - - "github.com/anacrolix/torrent/mse" - "github.com/anacrolix/libtorgo/bencode" "github.com/anacrolix/libtorgo/metainfo" "github.com/anacrolix/sync" + "github.com/anacrolix/utp" + "github.com/bradfitz/iter" + "github.com/anacrolix/torrent/data" filePkg "github.com/anacrolix/torrent/data/file" "github.com/anacrolix/torrent/dht" "github.com/anacrolix/torrent/internal/pieceordering" "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/logonce" + "github.com/anacrolix/torrent/mse" pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/tracker" _ "github.com/anacrolix/torrent/tracker/udp" . "github.com/anacrolix/torrent/util" - "github.com/anacrolix/utp" ) var ( diff --git a/client_test.go b/client_test.go index a3f1fda2..447d9414 100644 --- a/client_test.go +++ b/client_test.go @@ -11,14 +11,13 @@ import ( "testing" "time" - "github.com/anacrolix/torrent/data/blob" - + "github.com/anacrolix/libtorgo/bencode" + "github.com/anacrolix/utp" "github.com/bradfitz/iter" + "github.com/anacrolix/torrent/data/blob" "github.com/anacrolix/torrent/internal/testutil" "github.com/anacrolix/torrent/util" - "github.com/anacrolix/utp" - "github.com/anacrolix/libtorgo/bencode" ) func init() { diff --git a/cmd/torrent-verify/main.go b/cmd/torrent-verify/main.go index 4101c1d9..a3d97b24 100644 --- a/cmd/torrent-verify/main.go +++ b/cmd/torrent-verify/main.go @@ -9,9 +9,10 @@ import ( "os" "path/filepath" - "github.com/anacrolix/torrent/mmap_span" "github.com/anacrolix/libtorgo/metainfo" "launchpad.net/gommap" + + "github.com/anacrolix/torrent/mmap_span" ) var ( diff --git a/cmd/torrent/main.go b/cmd/torrent/main.go index 0e0295ba..6062d169 100644 --- a/cmd/torrent/main.go +++ b/cmd/torrent/main.go @@ -10,13 +10,10 @@ import ( "strings" "time" - "github.com/dustin/go-humanize" - - "github.com/jessevdk/go-flags" - _ "github.com/anacrolix/envpprof" - "github.com/anacrolix/libtorgo/metainfo" + "github.com/dustin/go-humanize" + "github.com/jessevdk/go-flags" "github.com/anacrolix/torrent" ) diff --git a/cmd/torrentfs/main.go b/cmd/torrentfs/main.go index 58cc8fd2..a7e786ae 100644 --- a/cmd/torrentfs/main.go +++ b/cmd/torrentfs/main.go @@ -13,14 +13,13 @@ import ( "syscall" "time" - _ "github.com/anacrolix/envpprof" - - "github.com/anacrolix/torrent/util/dirwatch" - "bazil.org/fuse" fusefs "bazil.org/fuse/fs" + _ "github.com/anacrolix/envpprof" + "github.com/anacrolix/torrent" "github.com/anacrolix/torrent/fs" + "github.com/anacrolix/torrent/util/dirwatch" ) var ( diff --git a/connection.go b/connection.go index aecc61f2..2469894d 100644 --- a/connection.go +++ b/connection.go @@ -12,6 +12,8 @@ import ( "sync" "time" + "github.com/anacrolix/libtorgo/bencode" + "github.com/anacrolix/torrent/internal/pieceordering" pp "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/connection_test.go b/connection_test.go index d55186ad..d93b7d05 100644 --- a/connection_test.go +++ b/connection_test.go @@ -4,12 +4,10 @@ import ( "testing" "time" - . "gopkg.in/check.v1" - "github.com/bradfitz/iter" + . "gopkg.in/check.v1" "github.com/anacrolix/torrent/internal/pieceordering" - "github.com/anacrolix/torrent/peer_protocol" ) diff --git a/data/blob/store.go b/data/blob/store.go index 874aa719..ddfcd599 100644 --- a/data/blob/store.go +++ b/data/blob/store.go @@ -12,8 +12,9 @@ import ( "sort" "time" - dataPkg "github.com/anacrolix/torrent/data" "github.com/anacrolix/libtorgo/metainfo" + + dataPkg "github.com/anacrolix/torrent/data" ) const ( diff --git a/data/mmap/mmap.go b/data/mmap/mmap.go index d071bade..d2223662 100644 --- a/data/mmap/mmap.go +++ b/data/mmap/mmap.go @@ -5,9 +5,10 @@ import ( "os" "path/filepath" - "github.com/anacrolix/torrent/mmap_span" "github.com/anacrolix/libtorgo/metainfo" "launchpad.net/gommap" + + "github.com/anacrolix/torrent/mmap_span" ) func TorrentData(md *metainfo.Info, location string) (mms *mmap_span.MMapSpan, err error) { diff --git a/dht/dht.go b/dht/dht.go index d2f14879..5f709934 100644 --- a/dht/dht.go +++ b/dht/dht.go @@ -14,11 +14,12 @@ import ( "os" "time" + "github.com/anacrolix/libtorgo/bencode" + "github.com/anacrolix/sync" + "github.com/anacrolix/torrent/iplist" "github.com/anacrolix/torrent/logonce" "github.com/anacrolix/torrent/util" - "github.com/anacrolix/sync" - "github.com/anacrolix/libtorgo/bencode" ) const ( diff --git a/dht/getpeers.go b/dht/getpeers.go index 326bb992..46ccd082 100644 --- a/dht/getpeers.go +++ b/dht/getpeers.go @@ -6,11 +6,11 @@ import ( "log" "time" - "github.com/anacrolix/torrent/logonce" - - "github.com/anacrolix/torrent/util" "github.com/anacrolix/sync" "github.com/willf/bloom" + + "github.com/anacrolix/torrent/logonce" + "github.com/anacrolix/torrent/util" ) type peerDiscovery struct { diff --git a/fs/torrentfs.go b/fs/torrentfs.go index abe06512..270bf3e4 100644 --- a/fs/torrentfs.go +++ b/fs/torrentfs.go @@ -9,11 +9,11 @@ import ( "sync" "time" + "bazil.org/fuse" + fusefs "bazil.org/fuse/fs" "github.com/anacrolix/libtorgo/metainfo" "golang.org/x/net/context" - "bazil.org/fuse" - fusefs "bazil.org/fuse/fs" "github.com/anacrolix/torrent" ) diff --git a/fs/torrentfs_test.go b/fs/torrentfs_test.go index b5b7c637..f45b7d81 100644 --- a/fs/torrentfs_test.go +++ b/fs/torrentfs_test.go @@ -14,19 +14,16 @@ import ( "testing" "time" - "github.com/anacrolix/torrent/data" - + "bazil.org/fuse" + fusefs "bazil.org/fuse/fs" + "github.com/anacrolix/libtorgo/metainfo" "golang.org/x/net/context" "github.com/anacrolix/torrent" + "github.com/anacrolix/torrent/data" "github.com/anacrolix/torrent/data/mmap" "github.com/anacrolix/torrent/internal/testutil" "github.com/anacrolix/torrent/util" - - "github.com/anacrolix/libtorgo/metainfo" - - "bazil.org/fuse" - fusefs "bazil.org/fuse/fs" ) func TestTCPAddrString(t *testing.T) { diff --git a/mse/mse.go b/mse/mse.go index 17cd52f1..9995301f 100644 --- a/mse/mse.go +++ b/mse/mse.go @@ -17,9 +17,9 @@ import ( "strconv" "sync" - "github.com/anacrolix/torrent/util" - "github.com/bradfitz/iter" + + "github.com/anacrolix/torrent/util" ) const ( diff --git a/mse/mse_test.go b/mse/mse_test.go index bc14c168..e363e332 100644 --- a/mse/mse_test.go +++ b/mse/mse_test.go @@ -7,10 +7,9 @@ import ( "io/ioutil" "net" "sync" + "testing" "github.com/bradfitz/iter" - - "testing" ) func TestReadUntil(t *testing.T) { diff --git a/torrent.go b/torrent.go index 056ad80f..7b9fff05 100644 --- a/torrent.go +++ b/torrent.go @@ -12,10 +12,10 @@ import ( "sync" "time" - "github.com/bradfitz/iter" - "github.com/anacrolix/libtorgo/bencode" "github.com/anacrolix/libtorgo/metainfo" + "github.com/bradfitz/iter" + "github.com/anacrolix/torrent/data" pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/tracker" diff --git a/util/dirwatch/dirwatch.go b/util/dirwatch/dirwatch.go index 220bb1b5..9669e834 100644 --- a/util/dirwatch/dirwatch.go +++ b/util/dirwatch/dirwatch.go @@ -9,10 +9,11 @@ import ( "path/filepath" "strings" - "github.com/anacrolix/torrent" - "github.com/anacrolix/torrent/util" "github.com/anacrolix/libtorgo/metainfo" "github.com/go-fsnotify/fsnotify" + + "github.com/anacrolix/torrent" + "github.com/anacrolix/torrent/util" ) type Change uint -- 2.44.0