Open
Description
Documentation of NewClient states:
Line 333 in 9780585
However, even if you pass a canceled context into NewClient, it has absolutely no effect.
For example:
func (c *Config) NewCustomClient(ctx context.Context) *http.Client {
ctx2, cancel := context.WithCancel(ctx)
cancel()
return oauth2.NewClient(ctx2, c.TokenSource(ctx))
}
and then make request with returned client:
c := cfg.NewCustomClient(context.Background())
req, _ := http.NewRequest(http.MethodGet, getURL().String(), http.NoBody)
req.Header.Set("Accept", "application/json")
resp, err := c.Do(req)
it has no effect.
or am I misunderstanding something?
Metadata
Metadata
Assignees
Labels
No labels