I have a custom http client, which has a default timeout value. The code is like this:
type Client struct {
*http.Client
timeout time.Duration
}
func (c *Client) Send(ctx context.Context, r *http.Request) (int, []byte, error) {
// If ctx has timeout set, then don't change it.
// Otherwise, create new context with ctx.WithTimeout(c.timeout)
}
How can I check if ctx
has timeout set or not?