Commit ee6568a5 authored by foxyriver's avatar foxyriver

use status code const to express http status

parent 48536eae
......@@ -263,7 +263,7 @@ func readHttpWithRetries(get httpget, duration time.Duration, u string, attempts
}
// Error - Set the error condition from the StatusCode
if statusCode != 200 {
if statusCode != http.StatusOK {
err = fmt.Errorf("unable to read URL %q, server reported %s, status code=%d", u, status, statusCode)
}
......
......@@ -96,7 +96,7 @@ func (s *sourceURL) extractFromURL() error {
if err != nil {
return err
}
if resp.StatusCode != 200 {
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("%v: %v", s.url, resp.Status)
}
if len(data) == 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment