]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Switch to goimports import sorting
authorMatt Joiner <anacrolix@gmail.com>
Fri, 2 Nov 2018 12:12:01 +0000 (23:12 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Fri, 2 Nov 2018 12:12:01 +0000 (23:12 +1100)
Used to use sortimports, but it's old, and goimports seems to have an opinion now.

54 files changed:
Peer.go
Peers.go
bencode/decode.go
client_test.go
cmd/magnet-metainfo/main.go
cmd/torrent-create/main.go
cmd/torrent-infohash/main.go
cmd/torrent-magnet/main.go
cmd/torrent-metainfo-pprint/main.go
cmd/torrent-pick/main.go
cmd/torrent-verify/main.go
cmd/torrent/main.go
cmd/torrentfs/main.go
cmd/tracker-announce/main.go
config.go
connection.go
connection_test.go
fs/file_handle.go
fs/filenode.go
fs/torrentfs.go
fs/torrentfs_test.go
internal/testutil/spec.go
iplist/cmd/pack-blocklist/main.go
issue211_test.go
issue97_test.go
metainfo/info_test.go
metainfo/metainfo_test.go
metainfo/nodes_test.go
misc.go
peer_protocol/handshake.go
peer_protocol/pex_test.go
piece.go
reader.go
reader_test.go
storage/boltPieceCompletion.go
storage/bolt_piece.go
storage/boltdb.go
storage/boltpc_test.go
storage/file.go
storage/file_misc_test.go
storage/file_test.go
storage/issue95_test.go
storage/issue96_test.go
storage/mmap.go
storage/piece_resource.go
storage/sqlitePieceCompletion.go
storage/wrappers.go
t.go
torrent.go
torrent_test.go
tracker/http.go
tracker/http_test.go
tracker_scraper.go
util/dirwatch/dirwatch.go

diff --git a/Peer.go b/Peer.go
index a51d86c07975179fedc4813ff7fb5743fa97075f..e4a7a2fb4cfcd6695b79d9567cf921a16b1680ef 100644 (file)
--- a/Peer.go
+++ b/Peer.go
@@ -4,7 +4,6 @@ import (
        "net"
 
        "github.com/anacrolix/dht/krpc"
-
        "github.com/anacrolix/torrent/peer_protocol"
 )
 
index 9c3e062cfa0ccde78e10897d02d759bb3a8ad99c..5d88bb3e50bbe60330d122a6c8b4d915d123a2a3 100644 (file)
--- 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"
 )
index c60bf17abdfce9bace95a485821a13457fbc5fa5..03488999f756d92524e5cb2b7d3f8926194949b8 100644 (file)
@@ -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:
index ca4041cf2ea25c03608d7ed27d5c7510c75907e9..0b12128f6e2a329c554edd3bb58dc65ed357fe08 100644 (file)
@@ -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 {
index 536f7abff308df7cab39fcbe70418bb11333c798..889651371cb5d5e1f5bd175fe330e80b97cde215 100644 (file)
@@ -9,7 +9,6 @@ import (
 
        _ "github.com/anacrolix/envpprof"
        "github.com/anacrolix/tagflag"
-
        "github.com/anacrolix/torrent"
        "github.com/anacrolix/torrent/bencode"
 )
index 4a429e9bcaeb7c7ace434b617e53b4b00250ae25..d62f8fd5d01210e3aea440943c03b3136fef7d30 100644 (file)
@@ -5,7 +5,6 @@ import (
        "os"
 
        "github.com/anacrolix/tagflag"
-
        "github.com/anacrolix/torrent/bencode"
        "github.com/anacrolix/torrent/metainfo"
 )
index 81319c99a4692778462de66c58dd79826db7ee1b..10a7bad930c9dbbd8fcb76f88957543fc395cbd8 100644 (file)
@@ -5,7 +5,6 @@ import (
        "log"
 
        "github.com/anacrolix/tagflag"
-
        "github.com/anacrolix/torrent/metainfo"
 )
 
index ee0ea2ec2b7b020eda6fd8ac67e12e9f2cd2ac06..a1d530779ddd32eec3bbd90a3775b64160501660 100644 (file)
@@ -5,7 +5,6 @@ import (
        "os"
 
        "github.com/anacrolix/tagflag"
-
        "github.com/anacrolix/torrent/metainfo"
 )
 
index 52c6c1069ec323002d974dd07d21eabe797c698a..ec78facf47cc4e3520827fae09a8a1834760726a 100644 (file)
@@ -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 {
index eada56876454a24bbe8db65da74623037eaa933c..07874e8af788590944a78a359975c515388c4f10 100644 (file)
@@ -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])
index dfd14a7400aee1a629dc155bf1293bad81a79910..525cced890ca4e88ea58c5f856797278e71485bb 100644 (file)
@@ -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) {
index abbb5521fd64a3fc0f331c561c5dbd494699cfcf..2cdf886ecfc56bea8c4de41aff4a4ef645765349 100644 (file)
@@ -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()
index b2d34efe53b3ed45a365655d8a02744fb5fe1b29..5a02cec24be43a8cf5477e6a4abfbcaf293144ed 100644 (file)
@@ -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"
index e038d872b9ca09b661c9ff2fe1d85042cd9486fa..f2eb02e419708bf8029af9924e96554aa49f957a 100644 (file)
@@ -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) {
index 964453af536c78176fe89ce55edbcf8dbc265bf6..31f2251387f796cdf7ff54d9d731311ec48a45ad 100644 (file)
--- 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,
        }
 }
 
index d0446e112315b4a1d9787be8a933caf1d21ffcd6..f58fca217ef2349ce8dc5e245619cf24ac7312ad 100644 (file)
@@ -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
index 949c55f44ecc8cb82a3b825a8627bfc2c7224b81..673b5e514a48c65d7aca9a8bb9db6c43a6b1a7e4 100644 (file)
@@ -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
index 41517296b2a0680ff4e59b2c5d49b3607fd8fbc7..48f3e5070ad1c8f7ed0c813080d63473afe12c8d 100644 (file)
@@ -7,7 +7,6 @@ import (
        "bazil.org/fuse"
        "bazil.org/fuse/fs"
        "github.com/anacrolix/missinggo"
-
        "github.com/anacrolix/torrent"
 )
 
index a7c807b4fe897d0f50d2c649cb6566f66706cd7b..b3f513f4b85ccba1bae8c88fd1c3e3624e3c2e85 100644 (file)
@@ -5,7 +5,6 @@ import (
 
        "bazil.org/fuse"
        fusefs "bazil.org/fuse/fs"
-
        "github.com/anacrolix/torrent"
 )
 
index e143eca2e15c90a9b128ff633922739221e2dc08..8e3e6898c3a0e7085f35e9268a46ac925d8d0af7 100644 (file)
@@ -9,7 +9,6 @@ import (
 
        "bazil.org/fuse"
        fusefs "bazil.org/fuse/fs"
-
        "github.com/anacrolix/torrent"
        "github.com/anacrolix/torrent/metainfo"
 )
index 716ea5f81fa2337adc4b93d86a402a3d96c41c81..4a37a351928d51aa0368004e641f073f2c5d8531 100644 (file)
@@ -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() {
index b2daa48bcbe7293a8bbb22d879a376e80d8c9a48..90accb4052ecf51a63cf78dc0862fac3d25d1eed 100644 (file)
@@ -6,7 +6,6 @@ import (
        "strings"
 
        "github.com/anacrolix/missinggo/expect"
-
        "github.com/anacrolix/torrent/bencode"
        "github.com/anacrolix/torrent/metainfo"
 )
index 037ceeba73e971e831c652f1fc91d391dea9de04..6ca81e054b5f2d7d4f7cc4c9f3ebbb615d178e59 100644 (file)
@@ -8,7 +8,6 @@ import (
 
        "github.com/anacrolix/missinggo"
        "github.com/anacrolix/tagflag"
-
        "github.com/anacrolix/torrent/iplist"
 )
 
index dedbaa5647a80a1337f94e10a7ef3aa38a2852b1..c12a9c9e303714a81de7d603cbe0cd6af978b336 100644 (file)
@@ -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) {
index 5ccfa62e6a9d00f4a99d3f6a6d2c693115866e12..5f36e67f68808927d9922f2efa21335917712148 100644 (file)
@@ -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) {
index cf1eaf8f0f5ec2b78f0951374ba1c7662edb12ef..bf2b9a1eab4d0ec2101f545b08b69d73c3e538b4 100644 (file)
@@ -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) {
index e54447ae5aadeebffb25a50171f5885dd15a1e24..5521f919a159cbf57e4967927af76a6a1efc45a3 100644 (file)
@@ -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) {
index adebbb3670371b2f96de91e61de6a76fe82a5fd2..3e54b961ce352f8adaa45fcfdfba32de42e075f8 100644 (file)
@@ -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 (file)
--- 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 {
index e3389171d84a4c44ea87f8d7700f4d2233a41b0b..fe232948b562a1898dfcf14d5212411af5a98ef3 100644 (file)
@@ -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
index 054c32beb9f6e79ff2d5ad04760ffeefff53925f..59a17c87f42b5d6620056d48a8880241b3e53e72 100644 (file)
@@ -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) {
index 6eef0cc13b199b37df647bb9bed5042fef01a3bb..e580754df63cef2037eba8539a66ce87106e2120 100644 (file)
--- 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"
index 71ddd480c8daa49683d40d41ac5b39a913653efa..07eefc87db05e67dccc952f24f245e9dc81966aa 100644 (file)
--- a/reader.go
+++ b/reader.go
@@ -8,7 +8,6 @@ import (
        "sync"
 
        "github.com/anacrolix/missinggo"
-
        "github.com/anacrolix/torrent/peer_protocol"
 )
 
index 86021dd60ae8c6bfff8af2a93c04ec7d49014483..c8ea81d8247497a27a061ec1c54694f30a2d580b 100644 (file)
@@ -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) {
index d0accb1df7da225184616b8cd1d68541adeb86b6..f0e21dc1efc64ed66bc4807d9e137aace0d305a5 100644 (file)
@@ -6,9 +6,8 @@ import (
        "path/filepath"
        "time"
 
-       "github.com/boltdb/bolt"
-
        "github.com/anacrolix/torrent/metainfo"
+       "github.com/boltdb/bolt"
 )
 
 const (
index 35120e0e1f52402eb2a295dd5ea9925ec40f08ce..a9e22bba3bbabc61d15533fce38d78104912cff4 100644 (file)
@@ -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 {
index 56c711ffee5edd34f6ac6e4a7759507a421e8da3..30f38c651dece2426d44efa75379d5ad79045963 100644 (file)
@@ -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 (
index 53fdbdb590a27a7e26c8c233779e7b10a7ae8acc..cce7c9109d80b2ed4a0b50920a0dae99db7bb3ec 100644 (file)
@@ -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) {
index fd4d56014f6cb230529ddecc82e26108411eac7f..d01b53af26b685bd7b96af9672c30d6737580790 100644 (file)
@@ -6,7 +6,6 @@ import (
        "path/filepath"
 
        "github.com/anacrolix/missinggo"
-
        "github.com/anacrolix/torrent/metainfo"
 )
 
index 8b453045c1d813282d74ee7d2a7a5fede5127c4a..9c6463450a606cc40987f47b7e166d60814b0a1a 100644 (file)
@@ -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) {
index 1a5e1b606d7df3b579f57424720927d2296abf05..719b98f2b28883690c8026ac21d5b0f829fefa82 100644 (file)
@@ -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) {
index d47410dae3c287c56c9b2d6bb66a4f309f75cc3a..9043eb4e7ddd0643aed3e32bae5229965a6edbda 100644 (file)
@@ -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
index 1bdbbf15cb73e7bde6fb701c0e3347b527e14def..21158f99efa393e37c52fe0ebae4abb92ee5c06d 100644 (file)
@@ -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) {
index 8bce4dc778827acea4096c57ff5dc37e479d1750..53455467742f492ef168ec9b8afe9bbdee5f4693 100644 (file)
@@ -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 {
index 1064fae557e9c4559a13253c751810c13f1b839b..8f6f9063b42129fd2e6281700524f067a538e8fa 100644 (file)
@@ -4,7 +4,6 @@ import (
        "path"
 
        "github.com/anacrolix/missinggo/resource"
-
        "github.com/anacrolix/torrent/metainfo"
 )
 
index 508b4fa49ae90015a6e8cdd9dd54f949478ba7b7..5a859d2325ef6a0257dd699e65265696c283a0d2 100644 (file)
@@ -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 {
index 4fc0e10d6208445ac2be8332964e9ee57381ca1b..c706e8dc850b46b05187ddc672cc62124abbbf0f 100644 (file)
@@ -5,7 +5,6 @@ import (
        "os"
 
        "github.com/anacrolix/missinggo"
-
        "github.com/anacrolix/torrent/metainfo"
 )
 
diff --git a/t.go b/t.go
index c66935c20c11a2ad6253b63d78de480db8c50eeb..043262066fe8a73b4d30e8f7c2a2ed14b065ab1a 100644 (file)
--- a/t.go
+++ b/t.go
@@ -4,7 +4,6 @@ import (
        "strings"
 
        "github.com/anacrolix/missinggo/pubsub"
-
        "github.com/anacrolix/torrent/metainfo"
 )
 
index 0b13fe257608753b4581e3962c35fabc8c70d5b7..9400bf281d52b455aa2bfa11e4a056e8d80f6fa2 100644 (file)
@@ -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 {
index 22053794368c87b888657fefee096919ca735505..22646ef2005ed391084b7965be8e6ff3b704e3e6 100644 (file)
@@ -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 {
index 58d9dc1144585b0f3b00dcce7e806a68b9932b7a..69764040d8996a51587872ff6eabe145143f6b12 100644 (file)
@@ -13,7 +13,6 @@ import (
 
        "github.com/anacrolix/dht/krpc"
        "github.com/anacrolix/missinggo/httptoo"
-
        "github.com/anacrolix/torrent/bencode"
 )
 
index c90a35ef5e11b362dab3afad799f994472e95cb2..1defeb8526aeee08ece2b25cc5d858a3ca72f528 100644 (file)
@@ -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"
index 0a87c868662ca464f9df98b483c91f61623c1426..5f31a0197f40a9a8d10fe7bdedab63d577908856 100644 (file)
@@ -10,7 +10,6 @@ import (
 
        "github.com/anacrolix/dht/krpc"
        "github.com/anacrolix/missinggo"
-
        "github.com/anacrolix/torrent/tracker"
 )
 
index 018d3f42a2a8815e3930df94257d2a7e9cec631b..3f784a73e74bbedd063d17e9109a70284959dfda 100644 (file)
@@ -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