...
Source file
src/net/hook.go
Documentation: net
1
2
3
4
5 package net
6
7 import (
8 "context"
9 "time"
10 )
11
12 var (
13
14 testHookDialTCP func(ctx context.Context, net string, laddr, raddr *TCPAddr) (*TCPConn, error)
15
16 testHookHostsPath = "/etc/hosts"
17 testHookLookupIP = func(
18 ctx context.Context,
19 fn func(context.Context, string, string) ([]IPAddr, error),
20 network string,
21 host string,
22 ) ([]IPAddr, error) {
23 return fn(ctx, network, host)
24 }
25 testHookSetKeepAlive = func(time.Duration) {}
26 )
27
View as plain text