gofmt simplify
This commit is contained in:
parent
04dedcef9f
commit
3602d90b65
|
@ -576,7 +576,7 @@ func TestCompletedPieceWrongSize(t *testing.T) {
|
|||
PieceLength: 15,
|
||||
Pieces: make([]byte, 20),
|
||||
Files: []metainfo.FileInfo{
|
||||
metainfo.FileInfo{Path: []string{"greeting"}, Length: 13},
|
||||
{Path: []string{"greeting"}, Length: 13},
|
||||
},
|
||||
}
|
||||
b, err := bencode.Marshal(info)
|
||||
|
@ -993,7 +993,7 @@ func TestClientDynamicListenPortNoProtocols(t *testing.T) {
|
|||
|
||||
func addClientPeer(t *Torrent, cl *Client) {
|
||||
t.AddPeers([]Peer{
|
||||
Peer{
|
||||
{
|
||||
IP: missinggo.AddrIP(cl.ListenAddr()),
|
||||
Port: missinggo.AddrPort(cl.ListenAddr()),
|
||||
},
|
||||
|
@ -1100,7 +1100,7 @@ func TestMultipleTorrentsWithEncryption(t *testing.T) {
|
|||
testutil.ExportStatusWriter(client, "c")
|
||||
tr, err := client.AddMagnet(magnet1)
|
||||
require.NoError(t, err)
|
||||
tr.AddPeers([]Peer{Peer{
|
||||
tr.AddPeers([]Peer{{
|
||||
IP: missinggo.AddrIP(server.ListenAddr()),
|
||||
Port: missinggo.AddrPort(server.ListenAddr()),
|
||||
}})
|
||||
|
|
|
@ -59,7 +59,7 @@ func TestMarshalUnmarshalMsg(t *testing.T) {
|
|||
T: "\x8c%",
|
||||
R: &Return{
|
||||
Values: []util.CompactPeer{
|
||||
util.CompactPeer{
|
||||
{
|
||||
IP: net.IPv4(1, 2, 3, 4).To4(),
|
||||
Port: 0x5678,
|
||||
},
|
||||
|
|
|
@ -186,7 +186,7 @@ func TestDownloadOnDemand(t *testing.T) {
|
|||
defer leecher.Close()
|
||||
leecherTorrent, _ := leecher.AddTorrent(layout.Metainfo)
|
||||
leecherTorrent.AddPeers([]torrent.Peer{
|
||||
torrent.Peer{
|
||||
{
|
||||
IP: missinggo.AddrIP(seeder.ListenAddr()),
|
||||
Port: missinggo.AddrPort(seeder.ListenAddr()),
|
||||
},
|
||||
|
|
|
@ -88,7 +88,7 @@ func TestAnnounceLocalhost(t *testing.T) {
|
|||
t.Parallel()
|
||||
srv := server{
|
||||
t: map[[20]byte]torrent{
|
||||
[20]byte{0xa3, 0x56, 0x41, 0x43, 0x74, 0x23, 0xe6, 0x26, 0xd9, 0x38, 0x25, 0x4a, 0x6b, 0x80, 0x49, 0x10, 0xa6, 0x67, 0xa, 0xc1}: {
|
||||
{0xa3, 0x56, 0x41, 0x43, 0x74, 0x23, 0xe6, 0x26, 0xd9, 0x38, 0x25, 0x4a, 0x6b, 0x80, 0x49, 0x10, 0xa6, 0x67, 0xa, 0xc1}: {
|
||||
Seeders: 1,
|
||||
Leechers: 2,
|
||||
Peers: []util.CompactPeer{
|
||||
|
|
|
@ -169,7 +169,7 @@ func (i *Instance) torrentAdded(e entity) {
|
|||
func (i *Instance) refresh() {
|
||||
_new := scanDir(i.dirName)
|
||||
old := i.dirState
|
||||
for ih, _ := range old {
|
||||
for ih := range old {
|
||||
_, ok := _new[ih]
|
||||
if !ok {
|
||||
i.torrentRemoved(ih)
|
||||
|
|
Loading…
Reference in New Issue