Used to use sortimports, but it's old, and goimports seems to have an opinion now.
"net"
"github.com/anacrolix/dht/krpc"
-
"github.com/anacrolix/torrent/peer_protocol"
)
import (
"github.com/anacrolix/dht/krpc"
-
"github.com/anacrolix/torrent/peer_protocol"
"github.com/anacrolix/torrent/tracker"
)
})
}
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:
_ "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 {
_ "github.com/anacrolix/envpprof"
"github.com/anacrolix/tagflag"
-
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/bencode"
)
"os"
"github.com/anacrolix/tagflag"
-
"github.com/anacrolix/torrent/bencode"
"github.com/anacrolix/torrent/metainfo"
)
"log"
"github.com/anacrolix/tagflag"
-
"github.com/anacrolix/torrent/metainfo"
)
"os"
"github.com/anacrolix/tagflag"
-
"github.com/anacrolix/torrent/metainfo"
)
"github.com/anacrolix/envpprof"
"github.com/anacrolix/tagflag"
- "github.com/bradfitz/iter"
-
"github.com/anacrolix/torrent/metainfo"
+ "github.com/bradfitz/iter"
)
var flags struct {
"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])
"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) {
"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()
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"
"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) {
"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"
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,
}
}
"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
"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
"bazil.org/fuse"
"bazil.org/fuse/fs"
"github.com/anacrolix/missinggo"
-
"github.com/anacrolix/torrent"
)
"bazil.org/fuse"
fusefs "bazil.org/fuse/fs"
-
"github.com/anacrolix/torrent"
)
"bazil.org/fuse"
fusefs "bazil.org/fuse/fs"
-
"github.com/anacrolix/torrent"
"github.com/anacrolix/torrent/metainfo"
)
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() {
"strings"
"github.com/anacrolix/missinggo/expect"
-
"github.com/anacrolix/torrent/bencode"
"github.com/anacrolix/torrent/metainfo"
)
"github.com/anacrolix/missinggo"
"github.com/anacrolix/tagflag"
-
"github.com/anacrolix/torrent/iplist"
)
"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) {
"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) {
import (
"testing"
- "github.com/stretchr/testify/assert"
-
"github.com/anacrolix/torrent/bencode"
+ "github.com/stretchr/testify/assert"
)
func TestMarshalInfo(t *testing.T) {
"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) {
"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) {
"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 {
"io"
"github.com/anacrolix/missinggo"
-
"github.com/anacrolix/torrent/metainfo"
)
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
import (
"testing"
- "github.com/stretchr/testify/require"
-
"github.com/anacrolix/torrent/bencode"
+ "github.com/stretchr/testify/require"
)
func TestUnmarshalPex(t *testing.T) {
"sync"
"github.com/anacrolix/missinggo/bitmap"
-
"github.com/anacrolix/torrent/metainfo"
pp "github.com/anacrolix/torrent/peer_protocol"
"github.com/anacrolix/torrent/storage"
"sync"
"github.com/anacrolix/missinggo"
-
"github.com/anacrolix/torrent/peer_protocol"
)
"testing"
"time"
- "github.com/stretchr/testify/require"
-
"github.com/anacrolix/torrent/internal/testutil"
+ "github.com/stretchr/testify/require"
)
func TestReaderReadContext(t *testing.T) {
"path/filepath"
"time"
- "github.com/boltdb/bolt"
-
"github.com/anacrolix/torrent/metainfo"
+ "github.com/boltdb/bolt"
)
const (
"encoding/binary"
"github.com/anacrolix/missinggo/x"
- "github.com/boltdb/bolt"
-
"github.com/anacrolix/torrent/metainfo"
+ "github.com/boltdb/bolt"
)
type boltDBPiece struct {
"time"
"github.com/anacrolix/missinggo/expect"
- "github.com/boltdb/bolt"
-
"github.com/anacrolix/torrent/metainfo"
+ "github.com/boltdb/bolt"
)
const (
"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) {
"path/filepath"
"github.com/anacrolix/missinggo"
-
"github.com/anacrolix/torrent/metainfo"
)
import (
"testing"
- "github.com/stretchr/testify/assert"
-
"github.com/anacrolix/torrent/metainfo"
+ "github.com/stretchr/testify/assert"
)
func TestExtentCompleteRequiredLengths(t *testing.T) {
"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) {
"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
"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) {
"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 {
"path"
"github.com/anacrolix/missinggo/resource"
-
"github.com/anacrolix/torrent/metainfo"
)
"database/sql"
"path/filepath"
- _ "github.com/mattn/go-sqlite3"
-
"github.com/anacrolix/torrent/metainfo"
+ _ "github.com/mattn/go-sqlite3"
)
type sqlitePieceCompletion struct {
"os"
"github.com/anacrolix/missinggo"
-
"github.com/anacrolix/torrent/metainfo"
)
"strings"
"github.com/anacrolix/missinggo/pubsub"
-
"github.com/anacrolix/torrent/metainfo"
)
"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 {
"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 {
"github.com/anacrolix/dht/krpc"
"github.com/anacrolix/missinggo/httptoo"
-
"github.com/anacrolix/torrent/bencode"
)
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"
"github.com/anacrolix/dht/krpc"
"github.com/anacrolix/missinggo"
-
"github.com/anacrolix/torrent/tracker"
)
"strings"
"github.com/anacrolix/missinggo"
- "github.com/fsnotify/fsnotify"
-
"github.com/anacrolix/torrent/metainfo"
+ "github.com/fsnotify/fsnotify"
)
type Change uint