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

httpx: Request 和 Response 初步设计 #236

Merged
merged 2 commits into from
Jan 1, 2024
Merged

Conversation

flycash
Copy link
Contributor

@flycash flycash commented Dec 29, 2023

在使用原生的 http 包的时候,充斥着大量的错误处理。这里我将整个过程简化了,只有在发起最终调用的时候,才会返回 error。

所谓的最终调用,就是指真正尝试解析 response 的时候,才会返回 error。在这之前,可以保持丝滑的链式调用。

Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (14dba09) 95.77% compared to head (1932a13) 95.64%.

Files Patch % Lines
net/httpx/response.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #236      +/-   ##
==========================================
- Coverage   95.77%   95.64%   -0.14%     
==========================================
  Files          62       65       +3     
  Lines        3265     3328      +63     
==========================================
+ Hits         3127     3183      +56     
- Misses        106      112       +6     
- Partials       32       33       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@flycash flycash merged commit 5a23504 into ecodeclub:dev Jan 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant