diff --git a/options.go b/options.go index 4da74b1..095be5a 100644 --- a/options.go +++ b/options.go @@ -112,7 +112,7 @@ func (opt *Options) init() { KeepAlive: 5 * time.Minute, } if opt.TLSConfig == nil { - return netDialer.Dial(network, addr) + return netDialer.DialContext(ctx, network, addr) } return tls.DialWithDialer(netDialer, opt.Network, opt.Addr, opt.TLSConfig) } diff --git a/redis_test.go b/redis_test.go index eb1bc98..d763380 100644 --- a/redis_test.go +++ b/redis_test.go @@ -51,7 +51,8 @@ var _ = Describe("Client", func() { Network: "tcp", Addr: redisAddr, Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { - return net.Dial(network, addr) + var d net.Dialer + return d.DialContext(ctx, network, addr) }, })