code: func readHttpWithRetries(get httpget, duration time.Duration, u string, attempts int) (io.ReadCloser, error) {
  	var err error
  	var body io.ReadCloser
  	if attempts <= 0 {
  		return nil, fmt.Errorf("http attempts must be greater than 0, was %d", attempts)
  	}
  	for i := 0; i < attempts; i++ {
  		var statusCode int
  		var status string
  		if i > 0 {
  			time.Sleep(duration)
  		}
  
  		// Try to get the URL
  		statusCode, status, body, err = get(u)
  
  		// Retry Errors
  		if err != nil {
  			continue
  		}
  
  		// Error - Set the error condition from the StatusCode
  		if statusCode != http.StatusOK {
  			err = fmt.Errorf("unable to read URL %q, server reported %s, status code=%d", u, status, statusCode)
  		}
  
  		if statusCode >= 500 && statusCode < 600 {
  			// Retry 500's
  			continue
  		} else {
  			// Don't retry other StatusCodes
  			break
  		}
  	}
  	return body, err
  }
docs: // readHttpWithRetries tries to http.Get the v.URL retries times before giving up.