From d6a49658415101dc2472a00c29fd47bc2f4256ae Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 17 Sep 2020 12:03:10 +0300 Subject: [PATCH] [#31] network: Remove unused dial functions Signed-off-by: Leonard Lyubich --- pkg/network/dial.go | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 pkg/network/dial.go diff --git a/pkg/network/dial.go b/pkg/network/dial.go deleted file mode 100644 index a506aeab3..000000000 --- a/pkg/network/dial.go +++ /dev/null @@ -1,26 +0,0 @@ -package network - -import ( - "context" - "net" - "time" - - manet "github.com/multiformats/go-multiaddr-net" -) - -// Dial connects to a remote node by address. -func Dial(ctx context.Context, addr Address) (net.Conn, error) { - return dialContext(ctx, addr, 0) -} - -// DialWithTimeout connects to a remote node by address with timeout. -func DialWithTimeout(ctx context.Context, addr Address, timeout time.Duration) (net.Conn, error) { - return dialContext(ctx, addr, timeout) -} - -func dialContext(ctx context.Context, addr Address, timeout time.Duration) (net.Conn, error) { - dialer := manet.Dialer{} - dialer.Timeout = timeout - - return dialer.DialContext(ctx, addr) -}