Go manages connection pooling automatically via the http.Transport type, which caches idle connections for reuse. To configure pool behavior, instantiate a Transport with specific limits like MaxIdleConns and MaxIdleConnsPerHost, then assign it to your http.Client.
client := &http.Client{
Transport: &http.Transport{
MaxIdleConns: 100,
MaxIdleConnsPerHost: 2,
IdleConnTimeout: 90 * time.Second,
},
}
If you need to disable connection reuse entirely, set DisableKeepAlives to true in the Transport configuration.