blob: d7316ea4383f5c359ee4e05cf25158719dce8a17 [file] [log] [blame]
Mikio Hara35b3db22015-04-04 01:11:10 +09001// 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
5package net
6
Brad Fitzpatrickb6b40042016-04-14 17:47:25 -07007import "context"
8
Mikio Harabe4c38e2015-04-07 11:37:29 +09009var (
Brad Fitzpatrickb6b40042016-04-14 17:47:25 -070010 // 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 Harabe4c38e2015-04-07 11:37:29 +090021 testHookSetKeepAlive = func() {}
22)