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:
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user