mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2025-03-23 13:00:08 +08:00
use context from stdlib
This commit is contained in:
parent
8b37b2c3bd
commit
c87d50ff49
@ -1,6 +1,7 @@
|
|||||||
package peerstore
|
package peerstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"sort"
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -8,7 +9,6 @@ import (
|
|||||||
peer "github.com/ipfs/go-libp2p-peer"
|
peer "github.com/ipfs/go-libp2p-peer"
|
||||||
addr "github.com/ipfs/go-libp2p-peerstore/addr"
|
addr "github.com/ipfs/go-libp2p-peerstore/addr"
|
||||||
ma "github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
"golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -25,12 +25,6 @@
|
|||||||
"name": "go-multiaddr",
|
"name": "go-multiaddr",
|
||||||
"version": "0.0.0"
|
"version": "0.0.0"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"author": "whyrusleeping",
|
|
||||||
"hash": "QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt",
|
|
||||||
"name": "go-net",
|
|
||||||
"version": "0.0.0"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"author": "whyrusleeping",
|
"author": "whyrusleeping",
|
||||||
"hash": "QmUusaX99BZoELh7dmPgirqRQ1FAmMnmnBn3oiqDFGBUSc",
|
"hash": "QmUusaX99BZoELh7dmPgirqRQ1FAmMnmnBn3oiqDFGBUSc",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package peerstore
|
package peerstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
@ -13,7 +14,6 @@ import (
|
|||||||
"github.com/ipfs/go-libp2p-peer"
|
"github.com/ipfs/go-libp2p-peer"
|
||||||
logging "github.com/ipfs/go-log"
|
logging "github.com/ipfs/go-log"
|
||||||
ma "github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
"golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = logging.Logger("peerstore")
|
var log = logging.Logger("peerstore")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package peerstore
|
package peerstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"sort"
|
"sort"
|
||||||
@ -9,7 +10,6 @@ import (
|
|||||||
|
|
||||||
peer "github.com/ipfs/go-libp2p-peer"
|
peer "github.com/ipfs/go-libp2p-peer"
|
||||||
ma "github.com/jbenet/go-multiaddr"
|
ma "github.com/jbenet/go-multiaddr"
|
||||||
"golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func getAddrs(t *testing.T, n int) []ma.Multiaddr {
|
func getAddrs(t *testing.T, n int) []ma.Multiaddr {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package queue
|
package queue
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
@ -8,8 +9,6 @@ import (
|
|||||||
|
|
||||||
u "github.com/ipfs/go-ipfs-util"
|
u "github.com/ipfs/go-ipfs-util"
|
||||||
peer "github.com/ipfs/go-libp2p-peer"
|
peer "github.com/ipfs/go-libp2p-peer"
|
||||||
|
|
||||||
context "golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestQueue(t *testing.T) {
|
func TestQueue(t *testing.T) {
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package queue
|
package queue
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
peer "github.com/ipfs/go-libp2p-peer"
|
peer "github.com/ipfs/go-libp2p-peer"
|
||||||
logging "github.com/ipfs/go-log"
|
logging "github.com/ipfs/go-log"
|
||||||
context "golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var log = logging.Logger("peerqueue")
|
var log = logging.Logger("peerqueue")
|
||||||
|
Loading…
Reference in New Issue
Block a user