Fix panic when setting a client http client with no transport (#3437)

Fixes #3436
This commit is contained in:
Jeff Mitchell
2017-10-09 08:49:20 -04:00
committed by GitHub
parent f0348318e7
commit 42953d6482
2 changed files with 12 additions and 0 deletions

View File

@@ -37,6 +37,15 @@ func TestDefaultConfig_envvar(t *testing.T) {
}
}
func TestClientDefaultHttpClient(t *testing.T) {
_, err := NewClient(&Config{
HttpClient: http.DefaultClient,
})
if err != nil {
t.Fatal(err)
}
}
func TestClientNilConfig(t *testing.T) {
client, err := NewClient(nil)
if err != nil {