Closed Necoro closed 2 years ago
Directly set the context instead of (implicitly) setting context.Background and then do a copy with the intended context.
context.Background
Rationale: The implementation of http.NewRequest
http.NewRequest
func NewRequest(method, url string, body io.Reader) (*Request, error) { return NewRequestWithContext(context.Background(), method, url, body) }
Directly set the context instead of (implicitly) setting
context.Background
and then do a copy with the intended context.Rationale: The implementation of
http.NewRequest