Conditions | 2 |
Total Lines | 6 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | package utils |
||
28 | func Timeout(connectTimeout time.Duration) func(cxt context.Context, net, addr string) (c net.Conn, err error) { |
||
29 | return func(ctx context.Context, network, address string) (net.Conn, error) { |
||
30 | return (&net.Dialer{ |
||
31 | Timeout: connectTimeout, |
||
32 | DualStack: true, |
||
33 | }).DialContext(ctx, network, address) |
||
34 | } |
||
36 |