diff options
author | Mikio Hara <mikioh.mikioh@gmail.com> | 2015-04-04 01:11:10 +0900 |
---|---|---|
committer | Mikio Hara <mikioh.mikioh@gmail.com> | 2015-04-07 02:34:42 +0000 |
commit | 35b3db253c4c43912b2cb3cc85594b9c1be03895 (patch) | |
tree | 667d911f120ea2b930cda3b08facd4ff915a8cdd /src/net/lookup.go | |
parent | bec4481dd39cdbbee2c0bc6e2c392ff73ca3f2f7 (diff) | |
download | go-35b3db253c4c43912b2cb3cc85594b9c1be03895.tar.gz go-35b3db253c4c43912b2cb3cc85594b9c1be03895.zip |
net: add lookup IP hook for testing
This change adds testHookLookIP to enable to inject DNS name to IP
address mappings for Happ{y,yish,ier} Eyeballs dial testing.
Change-Id: I8ac04a594e1e2bd77909528df0552889914a7790
Reviewed-on: https://go-review.googlesource.com/8399
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/lookup.go')
-rw-r--r-- | src/net/lookup.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/lookup.go b/src/net/lookup.go index 65abc81309..be4b0c2df6 100644 --- a/src/net/lookup.go +++ b/src/net/lookup.go @@ -46,7 +46,7 @@ var lookupGroup singleflight // is always owned by the caller. func lookupIPMerge(host string) (addrs []IPAddr, err error) { addrsi, err, shared := lookupGroup.Do(host, func() (interface{}, error) { - return lookupIP(host) + return testHookLookupIP(lookupIP, host) }) return lookupIPReturn(addrsi, err, shared) } @@ -84,7 +84,7 @@ func lookupIPDeadline(host string, deadline time.Time) (addrs []IPAddr, err erro defer t.Stop() ch := lookupGroup.DoChan(host, func() (interface{}, error) { - return lookupIP(host) + return testHookLookupIP(lookupIP, host) }) select { |