Mikio Hara | 35b3db2 | 2015-04-04 01:11:10 +0900 | [diff] [blame] | 1 | // Copyright 2015 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package net |
| 6 | |
Brad Fitzpatrick | b6b4004 | 2016-04-14 17:47:25 -0700 | [diff] [blame] | 7 | import "context" |
| 8 | |
Mikio Hara | be4c38e | 2015-04-07 11:37:29 +0900 | [diff] [blame] | 9 | var ( |
Brad Fitzpatrick | b6b4004 | 2016-04-14 17:47:25 -0700 | [diff] [blame] | 10 | // if non-nil, overrides dialTCP. |
| 11 | testHookDialTCP func(ctx context.Context, net string, laddr, raddr *TCPAddr) (*TCPConn, error) |
| 12 | |
| 13 | testHookHostsPath = "/etc/hosts" |
| 14 | testHookLookupIP = func( |
| 15 | ctx context.Context, |
| 16 | fn func(context.Context, string) ([]IPAddr, error), |
| 17 | host string, |
| 18 | ) ([]IPAddr, error) { |
| 19 | return fn(ctx, host) |
| 20 | } |
Mikio Hara | be4c38e | 2015-04-07 11:37:29 +0900 | [diff] [blame] | 21 | testHookSetKeepAlive = func() {} |
| 22 | ) |