code: func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rateLimitCategory) *RateLimitError {
  	c.rateMu.Lock()
  	rate := c.rateLimits[rateLimitCategory]
  	c.rateMu.Unlock()
  	if !rate.Reset.Time.IsZero() && rate.Remaining == 0 && time.Now().Before(rate.Reset.Time) {
  		// Create a fake response.
  		resp := &http.Response{
  			Status:     http.StatusText(http.StatusForbidden),
  			StatusCode: http.StatusForbidden,
  			Request:    req,
  			Header:     make(http.Header),
  			Body:       ioutil.NopCloser(strings.NewReader("")),
  		}
  		return &RateLimitError{
  			Rate:     rate,
  			Response: resp,
  			Message:  fmt.Sprintf("API rate limit of %v still exceeded until %v, not making remote request.", rate.Limit, rate.Reset.Time),
  		}
  	}
  
  	return nil
  }
docs: // checkRateLimitBeforeDo does not make any network calls, but uses existing knowledge from
  // current client state in order to quickly check if *RateLimitError can be immediately returned
  // from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily.
  // Otherwise it returns nil, and Client.Do should proceed normally.