mirror of https://github.com/golang/go.git
delegate the reset logic to the test
This commit is contained in:
parent
3fd729b2a1
commit
4da3da2d0b
|
|
@ -102,7 +102,8 @@ func NewTestTimeoutHandler(handler Handler, ctx context.Context) Handler {
|
|||
}
|
||||
|
||||
func ResetCachedEnvironment() {
|
||||
resetProxyConfig()
|
||||
envProxyOnce = sync.Once{}
|
||||
envProxyFuncValue = nil
|
||||
}
|
||||
|
||||
func (t *Transport) NumPendingRequestsForTesting() int {
|
||||
|
|
|
|||
|
|
@ -965,12 +965,6 @@ func envProxyFunc() func(*url.URL) (*url.URL, error) {
|
|||
return envProxyFuncValue
|
||||
}
|
||||
|
||||
// resetProxyConfig is used by tests.
|
||||
func resetProxyConfig() {
|
||||
envProxyOnce = sync.Once{}
|
||||
envProxyFuncValue = nil
|
||||
}
|
||||
|
||||
func (t *Transport) connectMethodForRequest(treq *transportRequest) (cm connectMethod, err error) {
|
||||
cm.targetScheme = treq.URL.Scheme
|
||||
cm.targetAddr = canonicalAddr(treq.URL)
|
||||
|
|
|
|||
Loading…
Reference in New Issue