Replace "GET", "POST" to http.MethodGet and http.MethodPost

This commit is contained in:
Haines Chan
2018-12-27 16:26:39 +08:00
committed by Haines Chan
parent 4329f407dc
commit b78b8aeee0
3 changed files with 11 additions and 11 deletions

View File

@@ -137,7 +137,7 @@ func checkHTTPErr(r *http.Response, validStatusCodes ...int) error {
if r.StatusCode == http.StatusNotFound {
return storage.ErrNotFound
}
if r.Request.Method == "POST" && r.StatusCode == http.StatusConflict {
if r.Request.Method == http.MethodPost && r.StatusCode == http.StatusConflict {
return storage.ErrAlreadyExists
}