Skip to content

Commit ef4e1bb

Browse files
authored
minor fixup
1 parent db791f2 commit ef4e1bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cleanhttp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ func DefaultPooledTransport() *http.Transport {
3333
// it can leak file descriptors over time. Only use this for transports that
3434
// will be re-used for the same host(s).
3535
func DefaultPooledTransportWithMin(minIdleConnsPerHost int) *http.Transport {
36-
maxIdleConnsPerHost := runtime.GOMAXPROCS(0) + 1
3736
transport := &http.Transport{
3837
Proxy: http.ProxyFromEnvironment,
3938
DialContext: (&net.Dialer{
@@ -47,6 +46,7 @@ func DefaultPooledTransportWithMin(minIdleConnsPerHost int) *http.Transport {
4746
ExpectContinueTimeout: 1 * time.Second,
4847
ForceAttemptHTTP2: true,
4948
MaxIdleConnsPerHost: func() int {
49+
maxIdleConnsPerHost := runtime.GOMAXPROCS(0) + 1
5050
if maxIdleConnsPerHost < minIdleConnsPerHost {
5151
return minIdleConnsPerHost
5252
}

0 commit comments

Comments
 (0)