privatize the client, only expose Dial functions

This commit is contained in:
Marten Seemann
2017-02-22 12:21:33 +07:00
parent 48dee2708e
commit 96edca5219
7 changed files with 214 additions and 188 deletions

View File

@@ -12,6 +12,7 @@ import (
)
type h2quicClient interface {
Dial() error
Do(*http.Request) (*http.Response, error)
}
@@ -92,8 +93,8 @@ func (r *QuicRoundTripper) getClient(hostname string) (h2quicClient, error) {
client, ok := r.clients[hostname]
if !ok {
var err error
client, err = NewClient(r, r.TLSClientConfig, hostname)
client = NewClient(r, r.TLSClientConfig, hostname)
err := client.Dial()
if err != nil {
return nil, err
}