Commit b6aff366 authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub
Browse files

Merge pull request #126 from libp2p/feat/use-stdlib-ctx

switch to using stdlib context package
parents 87b0e200 4dd30d82
......@@ -10,11 +10,11 @@ import (
testutil "github.com/libp2p/go-libp2p/testutil"
ci "github.com/libp2p/go-libp2p/testutil/ci"
"context"
peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr"
manet "github.com/jbenet/go-multiaddr-net"
context "golang.org/x/net/context"
)
func closeSwarms(swarms []*Swarm) {
......
......@@ -3,10 +3,10 @@ package swarm
import (
"testing"
"context"
peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr"
context "golang.org/x/net/context"
)
func TestPeers(t *testing.T) {
......
......@@ -8,10 +8,10 @@ import (
ci "github.com/libp2p/go-libp2p/testutil/ci"
"context"
peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr"
context "golang.org/x/net/context"
)
func TestSimultOpen(t *testing.T) {
......
......@@ -7,9 +7,9 @@ import (
addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
testutil "github.com/libp2p/go-libp2p/testutil"
"context"
pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr"
context "golang.org/x/net/context"
)
func TestFilterAddrs(t *testing.T) {
......
......@@ -6,11 +6,11 @@ import (
inet "github.com/libp2p/go-libp2p/p2p/net"
conn "github.com/libp2p/go-libp2p/p2p/net/conn"
"context"
ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer"
ma "github.com/jbenet/go-multiaddr"
ps "github.com/jbenet/go-peerstream"
context "golang.org/x/net/context"
)
// Conn is a simple wrapper around a ps.Conn that also exposes
......
......@@ -3,6 +3,7 @@ package swarm
import (
"fmt"
"context"
lgbl "github.com/ipfs/go-libp2p-loggables"
ma "github.com/jbenet/go-multiaddr"
ps "github.com/jbenet/go-peerstream"
......@@ -10,7 +11,6 @@ import (
mconn "github.com/libp2p/go-libp2p/p2p/metrics/conn"
inet "github.com/libp2p/go-libp2p/p2p/net"
conn "github.com/libp2p/go-libp2p/p2p/net/conn"
context "golang.org/x/net/context"
)
func (s *Swarm) AddListenAddr(a ma.Multiaddr) error {
......
......@@ -8,9 +8,9 @@ import (
metrics "github.com/libp2p/go-libp2p/p2p/metrics"
inet "github.com/libp2p/go-libp2p/p2p/net"
"context"
ma "github.com/jbenet/go-multiaddr"
"github.com/jbenet/goprocess"
context "golang.org/x/net/context"
)
// Network implements the inet.Network interface.
......
......@@ -7,7 +7,7 @@ import (
inet "github.com/libp2p/go-libp2p/p2p/net"
testutil "github.com/libp2p/go-libp2p/p2p/test/util"
context "golang.org/x/net/context"
"context"
)
// TestConnectednessCorrect starts a few networks, connects a few
......
......@@ -4,10 +4,10 @@ import (
"testing"
"time"
"context"
peer "github.com/ipfs/go-libp2p-peer"
ma "github.com/jbenet/go-multiaddr"
inet "github.com/libp2p/go-libp2p/p2p/net"
context "golang.org/x/net/context"
)
func streamsSame(a, b inet.Stream) bool {
......
......@@ -13,10 +13,10 @@ import (
inet "github.com/libp2p/go-libp2p/p2p/net"
testutil "github.com/libp2p/go-libp2p/testutil"
"context"
peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr"
context "golang.org/x/net/context"
)
func EchoStreamHandler(stream inet.Stream) {
......
package identify
import (
"context"
"strings"
"sync"
......@@ -15,7 +16,6 @@ import (
inet "github.com/libp2p/go-libp2p/p2p/net"
pb "github.com/libp2p/go-libp2p/p2p/protocol/identify/pb"
msmux "github.com/whyrusleeping/go-multistream"
context "golang.org/x/net/context"
lgbl "github.com/ipfs/go-libp2p-loggables"
logging "github.com/ipfs/go-log"
......
......@@ -10,8 +10,8 @@ import (
identify "github.com/libp2p/go-libp2p/p2p/protocol/identify"
testutil "github.com/libp2p/go-libp2p/p2p/test/util"
"context"
ma "github.com/jbenet/go-multiaddr"
context "golang.org/x/net/context"
)
func subtestIDService(t *testing.T, postDialWait time.Duration) {
......
......@@ -2,6 +2,7 @@ package ping
import (
"bytes"
"context"
"errors"
"io"
"time"
......@@ -11,7 +12,6 @@ import (
logging "github.com/ipfs/go-log"
host "github.com/libp2p/go-libp2p/p2p/host"
inet "github.com/libp2p/go-libp2p/p2p/net"
context "golang.org/x/net/context"
)
var log = logging.Logger("ping")
......
......@@ -6,9 +6,9 @@ import (
netutil "github.com/libp2p/go-libp2p/p2p/test/util"
"context"
peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore"
context "golang.org/x/net/context"
)
func TestPing(t *testing.T) {
......
......@@ -5,13 +5,13 @@ import (
"io"
"time"
"context"
peer "github.com/ipfs/go-libp2p-peer"
logging "github.com/ipfs/go-log"
mh "github.com/jbenet/go-multihash"
host "github.com/libp2p/go-libp2p/p2p/host"
inet "github.com/libp2p/go-libp2p/p2p/net"
protocol "github.com/libp2p/go-libp2p/p2p/protocol"
context "golang.org/x/net/context"
)
var log = logging.Logger("github.com/libp2p/go-libp2p/p2p/protocol/relay")
......
......@@ -4,13 +4,13 @@ import (
"io"
"testing"
"context"
logging "github.com/ipfs/go-log"
inet "github.com/libp2p/go-libp2p/p2p/net"
protocol "github.com/libp2p/go-libp2p/p2p/protocol"
relay "github.com/libp2p/go-libp2p/p2p/protocol/relay"
testutil "github.com/libp2p/go-libp2p/p2p/test/util"
msmux "github.com/whyrusleeping/go-multistream"
context "golang.org/x/net/context"
)
var log = logging.Logger("relay_test")
......
......@@ -6,6 +6,7 @@ import (
"testing"
"time"
"context"
u "github.com/ipfs/go-ipfs-util"
peer "github.com/ipfs/go-libp2p-peer"
logging "github.com/ipfs/go-log"
......@@ -13,7 +14,6 @@ import (
inet "github.com/libp2p/go-libp2p/p2p/net"
protocol "github.com/libp2p/go-libp2p/p2p/protocol"
testutil "github.com/libp2p/go-libp2p/p2p/test/util"
context "golang.org/x/net/context"
)
var log = logging.Logger("backpressure")
......
package reconnect
import (
"context"
"io"
"math/rand"
"sync"
......@@ -15,7 +16,6 @@ import (
swarm "github.com/libp2p/go-libp2p/p2p/net/swarm"
protocol "github.com/libp2p/go-libp2p/p2p/protocol"
testutil "github.com/libp2p/go-libp2p/p2p/test/util"
context "golang.org/x/net/context"
)
func init() {
......
......@@ -10,8 +10,8 @@ import (
swarm "github.com/libp2p/go-libp2p/p2p/net/swarm"
tu "github.com/libp2p/go-libp2p/testutil"
"context"
ma "github.com/jbenet/go-multiaddr"
context "golang.org/x/net/context"
)
func GenSwarmNetwork(t *testing.T, ctx context.Context) *swarm.Network {
......
......@@ -103,11 +103,6 @@
"name": "randbo",
"version": "0.0.0"
},
{
"hash": "QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt",
"name": "go-net",
"version": "0.0.0"
},
{
"hash": "Qmb1US8uyZeEpMyc56wVZy2cDFdQjNFojAUYVCoo9ieTqp",
"name": "go-stream-muxer",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment