Commit 3b015616 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: improve Client.Timeout docs, quiet test

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/70930043
parent 77720904
...@@ -56,12 +56,11 @@ type Client struct { ...@@ -56,12 +56,11 @@ type Client struct {
// in responses. // in responses.
Jar CookieJar Jar CookieJar
// Timeout specifies the end-to-end timeout for requests made // Timeout specifies a time limit for requests made by this
// via this Client. The timeout includes connection time, any // Client. The timeout includes connection time, any
// redirects, and reading the response body. The timeout // redirects, and reading the response body. The timer remains
// remains running once Get, Head, Post, or Do returns and // running after Get, Head, Post, or Do return and will
// will interrupt the read of the Response.Body if EOF hasn't // interrupt reading of the Response.Body.
// been reached.
// //
// A Timeout of zero means no timeout. // A Timeout of zero means no timeout.
// //
......
...@@ -874,7 +874,7 @@ func TestClientTimeout(t *testing.T) { ...@@ -874,7 +874,7 @@ func TestClientTimeout(t *testing.T) {
if err == nil { if err == nil {
t.Error("expected error from ReadAll") t.Error("expected error from ReadAll")
} }
t.Logf("Got expected ReadAll error of %v after reading body %q", err, all) // Expected error.
case <-time.After(failTime): case <-time.After(failTime):
t.Errorf("timeout after %v waiting for timeout of %v", failTime, timeout) t.Errorf("timeout after %v waiting for timeout of %v", failTime, timeout)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment