use fmt.Errorf(...) instead of errors.new(fmt.Sprintf(...))

Signed-off-by: Benoit Gagnon <benoit.gagnon@ubisoft.com>
This commit is contained in:
Benoit Gagnon 2019-10-24 11:05:54 -04:00
parent f09b41c7da
commit 2bf42f11cd

View file

@ -53,7 +53,7 @@ func downloadGitHubArchive(filepath string, url string) error {
}
color.Cyan("GET %s %d", url, resp.StatusCode)
if resp.StatusCode != 200 {
return errors.New(fmt.Sprintf("unexpected status code %d", resp.StatusCode))
return fmt.Errorf("unexpected status code %d", resp.StatusCode)
}
defer resp.Body.Close()