code: func CheckResponse(resp *http.Response) error {
  	if code := resp.StatusCode; 200 <= code && code <= 299 {
  		return nil
  	}
  
  	errorResponse := &ErrorResponse{}
  	errorResponse.HttpResponse = resp
  
  	err := json.NewDecoder(resp.Body).Decode(errorResponse)
  	if err != nil {
  		return err
  	}
  
  	return errorResponse
  }
docs: // CheckResponse checks the API response for errors, and returns them if present.
  // A response is considered an error if the status code is different than 2xx. Specific requests
  // may have additional requirements, but this is sufficient in most of the cases.