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

add response pkg #16

Merged
merged 1 commit into from
Apr 15, 2022
Merged

add response pkg #16

merged 1 commit into from
Apr 15, 2022

Conversation

veezhang
Copy link
Contributor

@veezhang veezhang commented Apr 15, 2022

as title

@veezhang veezhang requested review from nianiaJR and kqzh April 15, 2022 03:01
kqzh
kqzh previously approved these changes Apr 15, 2022
Copy link
Contributor

@kqzh kqzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@veezhang veezhang changed the title middleware:StandardResponseHandler http.Request maybe nil add response pkg Apr 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 15, 2022

Codecov Report

Merging #16 (15afb8a) into master (2bac74f) will increase coverage by 1.09%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           master       #16      +/-   ##
===========================================
+ Coverage   98.90%   100.00%   +1.09%     
===========================================
  Files          13        13              
  Lines         638       624      -14     
===========================================
- Hits          631       624       -7     
+ Misses          5         0       -5     
+ Partials        2         0       -2     
Impacted Files Coverage Δ
response/standard_handler.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bac74f...15afb8a. Read the comment docs.

}

func (h *standardHandler) GetStatusBody(r *http.Request, data interface{}, err error) (httpStatus int, body interface{}) {
httpStatus = http.StatusOK
Copy link
Contributor

@nianiaJR nianiaJR Apr 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use GetResponse? StatusBody seems to be like just returning one field. The func name is little strange

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StatusBody means Status and Body.

GetResponse is easily misunderstood as http.Response.

Copy link
Contributor

@nianiaJR nianiaJR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@veezhang veezhang merged commit 97328dd into vesoft-inc:master Apr 15, 2022
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.

4 participants