code: func CheckResponse(r *http.Response) error {
  	if c := r.StatusCode; 200 <= c && c <= 299 {
  		return nil
  	}
  	errorResponse := &ErrorResponse{Response: r}
  	data, err := ioutil.ReadAll(r.Body)
  	if err == nil && data != nil {
  		json.Unmarshal(data, errorResponse)
  	}
  	return errorResponse
  }
docs: // CheckResponse receives a pointer to a http.Response and generates an Error via unmarshalling