1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

refactor: rename ParseResponse to ParseHttpResponse func in netutil/request.go

This commit is contained in:
dudaodong
2021-12-17 17:29:28 +08:00
parent e87f3b70f0
commit f1dbd943aa
2 changed files with 3 additions and 3 deletions

View File

@@ -45,8 +45,8 @@ func HttpPatch(url string, params ...interface{}) (*http.Response, error) {
return request(http.MethodPatch, url, params...)
}
// ParseResponse convert the http response to interface{} obj
func ParseResponse(resp *http.Response, obj interface{}) error {
// ParseHttpResponse convert the http response to interface{} obj
func ParseHttpResponse(resp *http.Response, obj interface{}) error {
if resp == nil {
return errors.New("InvalidResp")
}

View File

@@ -119,7 +119,7 @@ func TestParseResponse(t *testing.T) {
t.FailNow()
}
userResp := &UserResp{}
err = ParseResponse(resp, userResp)
err = ParseHttpResponse(resp, userResp)
if err != nil {
log.Fatal(err)
t.FailNow()