use fmt.Errorf instead of error.New() (#149)
This commit is contained in:
+1
-4
@@ -17,7 +17,6 @@ limitations under the License.
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -45,9 +44,7 @@ func fnFetchCode(filePath string) []byte {
|
|||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
err = fmt.Errorf("%v - HTTP response returned non 200 status", resp.StatusCode)
|
||||||
err = errors.New(fmt.Sprintf("%v - HTTP response returned non 200 status",
|
|
||||||
resp.StatusCode))
|
|
||||||
checkErr(err, fmt.Sprintf("download function"))
|
checkErr(err, fmt.Sprintf("download function"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user