直接读源码吧。
看注释:
// 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.
//
// The Client cancels requests to the underlying Transport
// as if the Request's Context ended.
//
// For compatibility, the Client will also use the deprecated
// CancelRequest method on Transport if found. New
// RoundTripper implementations should use the Request's Context
// for cancellation instead of implementing CancelRequest.
机翻结果:
Timeout指定此客户端发出的请求的时间限制。超时包括连接时间、任何重定向和读取响应体。定时器在Get、Head、Post或Do返回后继续运行,并将中断Response.Body的读取。超时为零表示没有超时。客户端取消对底层传输的请求,就好像请求的上下文结束了一样。为了兼容性,如果找到,客户端还将在传输上使用已弃用的CancelRequest方法。新的RoundTripper实现应该使用Request的Context来取消,而不是实现CancelRequest。