resty
resty copied to clipboard
implement `SetTimeout` without touching http.Client.Timeout
trafficstars
currently SetTimeout just modify http.Client.Timeout
func (c *Client) SetTimeout(timeout time.Duration) *Client {
c.httpClient.Timeout = timeout
return c
}
when we create resty.Client with NewWithClient. it do side effect if we use http.Client in other code.
maybe we should keep timeout in resty.Client, and do context.WithTimeout before every request?
+1
https://github.com/go-resty/resty/issues/574
I implemented session pattern, you can use