feat: use context for HTTP request in discord#5232
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5232 +/- ##
==========================================
- Coverage 83.77% 82.00% -1.77%
==========================================
Files 135 141 +6
Lines 13029 13915 +886
==========================================
+ Hits 10915 11411 +496
- Misses 1677 2021 +344
- Partials 437 483 +46 ☔ View full report in Codecov by Sentry. |
caarlos0
approved these changes
Oct 31, 2024
Member
|
thank you! |
caarlos0
pushed a commit
that referenced
this pull request
Nov 16, 2024
This PR adds using `context.Context` in HTTP requests. Changes are similar to #5232. Additionally, it enables `noctx` to automatically detect missing context: ``` internal/pipe/webhook/webhook.go:85:29: should rewrite http.NewRequestWithContext or add (*Request).WithContext (noctx) internal/pipe/linkedin/client.go:68:27: (*net/http.Client).Get must not be called (noctx) internal/pipe/linkedin/client.go:101:27: (*net/http.Client).Get must not be called (noctx) internal/pipe/linkedin/client.go:172:28: (*net/http.Client).Post must not be called (noctx) ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PR adds using
context.Contextin thePOSTrequest.Context is a request scoped paradigm according to the doc.
The PR adds
APIfield into theConfigfor utilizing it in tests.