From 3045d56503d70b774a5ba31cd5643640a7ed5b55 Mon Sep 17 00:00:00 2001 From: dudaodong Date: Mon, 20 Dec 2021 11:43:39 +0800 Subject: [PATCH] release: update readme.file v1.0.8, ParseHttpResponse in netutil/request.go --- README.md | 3 ++- README_zh-CN.md | 3 ++- netutil/request.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 27cc46f..509d549 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@
![Go version](https://img.shields.io/badge/go-%3E%3D1.16-9cf) -[![Release](https://img.shields.io/badge/release-1.0.7-green.svg)](https://github.com/duke-git/lancet/releases) +[![Release](https://img.shields.io/badge/release-1.0.8-green.svg)](https://github.com/duke-git/lancet/releases) [![GoDoc](https://godoc.org/github.com//duke-git/lancet?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet) [![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet) [![codecov](https://codecov.io/gh/duke-git/lancet/branch/main/graph/badge.svg?token=FC48T1F078)](https://codecov.io/gh/duke-git/lancet) @@ -323,6 +323,7 @@ func HttpPut(url string, params ...interface{}) (*http.Response, error) //http p func HttpDelete(url string, params ...interface{}) (*http.Response, error) //http delete request func HttpPatch(url string, params ...interface{}) (*http.Response, error) //http patch request func ConvertMapToQueryString(param map[string]interface{}) string //convert map to url query string +func ParseHttpResponse(resp *http.Response, obj interface{}) error //decode http response to specified interface ``` #### 8. random is for rand string and int generation diff --git a/README_zh-CN.md b/README_zh-CN.md index c99c88a..e720029 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -6,7 +6,7 @@
![Go version](https://img.shields.io/badge/go-%3E%3D1.16-9cf) -[![Release](https://img.shields.io/badge/release-1.0.7-green.svg)](https://github.com/duke-git/lancet/releases) +[![Release](https://img.shields.io/badge/release-1.0.8-green.svg)](https://github.com/duke-git/lancet/releases) [![GoDoc](https://godoc.org/github.com//duke-git/lancet?status.svg)](https://pkg.go.dev/github.com/duke-git/lancet) [![Go Report Card](https://goreportcard.com/badge/github.com/duke-git/lancet)](https://goreportcard.com/report/github.com/duke-git/lancet) [![codecov](https://codecov.io/gh/duke-git/lancet/branch/main/graph/badge.svg?token=FC48T1F078)](https://codecov.io/gh/duke-git/lancet) @@ -324,6 +324,7 @@ func HttpPut(url string, params ...interface{}) (*http.Response, error) //http p func HttpDelete(url string, params ...interface{}) (*http.Response, error) //http delete请求 func HttpPatch(url string, params ...interface{}) (*http.Response, error) //http patch请求 func ConvertMapToQueryString(param map[string]interface{}) string //将map转换成url query string +func ParseHttpResponse(resp *http.Response, obj interface{}) error //将http响应解码成特定interface ``` #### 8. random随机数处理包 diff --git a/netutil/request.go b/netutil/request.go index 4e26994..baf563e 100644 --- a/netutil/request.go +++ b/netutil/request.go @@ -45,7 +45,7 @@ func HttpPatch(url string, params ...interface{}) (*http.Response, error) { return request(http.MethodPatch, url, params...) } -// ParseHttpResponse convert the http response to interface{} obj +// ParseHttpResponse decode http response to specified interface func ParseHttpResponse(resp *http.Response, obj interface{}) error { if resp == nil { return errors.New("InvalidResp")