Use http constants instead of string

Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
Fish-pro
2023-02-10 14:01:48 +08:00
parent a6f3cbe0ad
commit 76a62e52ae
2 changed files with 3 additions and 3 deletions

View File

@@ -225,7 +225,7 @@ func httpGetRequest(client *http.Client, request string) (io.ReadCloser, error)
if err != nil {
return nil, err
}
if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
resp.Body.Close()
return nil, fmt.Errorf("http get failed with status: %s", resp.Status)
}