From fd180e0e218232c67b867bd104c1d5d7b1c932f4 Mon Sep 17 00:00:00 2001 From: gmdutra Date: Sun, 17 May 2020 02:57:26 -0300 Subject: [PATCH] Adds the StatusOk constant --- file.go | 2 +- github.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/file.go b/file.go index 682160b..db91dce 100644 --- a/file.go +++ b/file.go @@ -37,7 +37,7 @@ func downloadGithubZipFile(gitHubCommit GitHubCommit, gitHubToken string, instan if err != nil { return zipFilePath, wrapError(err) } - if resp.StatusCode != 200 { + if resp.StatusCode != http.StatusOK { return zipFilePath, newError(FAILED_TO_DOWNLOAD_FILE, fmt.Sprintf("Failed to download file at the url %s. Received HTTP Response %d.", req.URL.String(), resp.StatusCode)) } if resp.Header.Get("Content-Type") != "application/zip" { diff --git a/github.go b/github.go index 982f39f..cd9183b 100644 --- a/github.go +++ b/github.go @@ -221,7 +221,7 @@ func callGitHubApi(repo GitHubRepo, path string, customHeaders map[string]string return nil, wrapError(err) } - if resp.StatusCode != 200 { + if resp.StatusCode != http.StatusOK { // Convert the resp.Body to a string buf := new(bytes.Buffer) _, goErr := buf.ReadFrom(resp.Body)