From b561f7d948d97b78d6af887dd196e95fb4a90f2c Mon Sep 17 00:00:00 2001 From: maxwell <710028463@qq.com> Date: Wed, 15 Mar 2017 07:23:32 +0800 Subject: [PATCH] use fmt.Errorf instead of error.New() (#149) --- fission/function.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fission/function.go b/fission/function.go index 2fbde693..8599b2ff 100644 --- a/fission/function.go +++ b/fission/function.go @@ -17,7 +17,6 @@ limitations under the License. package main import ( - "errors" "fmt" "io/ioutil" "net/http" @@ -45,9 +44,7 @@ func fnFetchCode(filePath string) []byte { defer resp.Body.Close() if resp.StatusCode != http.StatusOK { - - err = errors.New(fmt.Sprintf("%v - HTTP response returned non 200 status", - resp.StatusCode)) + err = fmt.Errorf("%v - HTTP response returned non 200 status", resp.StatusCode) checkErr(err, fmt.Sprintf("download function")) }