1
0
mirror of https://github.com/golang/go synced 2024-09-24 17:10:13 -06:00

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

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/70930043
This commit is contained in:
Brad Fitzpatrick 2014-03-04 13:41:05 -08:00
parent 77720904a8
commit 3b015616f7
2 changed files with 6 additions and 7 deletions

View File

@ -56,12 +56,11 @@ type Client struct {
// in responses.
Jar CookieJar
// Timeout specifies the end-to-end timeout for requests made
// via this Client. The timeout includes connection time, any
// redirects, and reading the response body. The timeout
// remains running once Get, Head, Post, or Do returns and
// will interrupt the read of the Response.Body if EOF hasn't
// been reached.
// Timeout specifies a time limit for requests made by this
// Client. The timeout includes connection time, any
// redirects, and reading the response body. The timer remains
// running after Get, Head, Post, or Do return and will
// interrupt reading of the Response.Body.
//
// A Timeout of zero means no timeout.
//

View File

@ -874,7 +874,7 @@ func TestClientTimeout(t *testing.T) {
if err == nil {
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):
t.Errorf("timeout after %v waiting for timeout of %v", failTime, timeout)
}