Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: make http client request with context #132

Merged
merged 2 commits into from Jan 21, 2020

Conversation

desimone
Copy link
Contributor

@desimone desimone commented Jan 2, 2020

http: use NewRequestWithContext to support cancellation

  • use ctx naming convention
  • prefer context.TODO() to nil

Sorry, missed a few of these in my first go.

- use ctx naming convention
- use context.TODO() instead of nil

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
@desimone desimone changed the title http: use http.NewRequestWithContext http: use NewRequestWithContext Jan 2, 2020
@bradfitz
Copy link
Contributor

bradfitz commented Jan 6, 2020

Sorry, NewRequestWithContext is too new (Go 1.13) to start using already.

Use Request.WithContext instead for now.

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
@desimone
Copy link
Contributor Author

desimone commented Jan 6, 2020

@bradfitz

Sorry, NewRequestWithContext is too new (Go 1.13) to start using already.

TIL!

Use Request.WithContext instead for now.

Done!

@desimone desimone changed the title http: use NewRequestWithContext http: make http client request with context Jan 11, 2020
@bradfitz bradfitz merged commit 8c9f03a into golang:master Jan 21, 2020
scbizu added a commit to ezbuy/groupcache that referenced this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants