code: func getWithStatusError(url string) (resp *http.Response, err error) {
  	if resp, err = http.Get(url); err != nil {
  		return nil, err
  	}
  	if resp.StatusCode < 400 {
  		return resp, nil
  	}
  	msg := fmt.Sprintf("failed to GET %s with status %s", url, resp.Status)
  	body, err := ioutil.ReadAll(resp.Body)
  	resp.Body.Close()
  	if err != nil {
  		return nil, errors.Wrapf(err, msg+": error reading body")
  	}
  	return nil, errors.Errorf(msg+": %s", bytes.TrimSpace(body))
  }
docs: // getWithStatusError does an http.Get() and returns an error if the
  // status code is 4xx or 5xx.