code: func (s *CatIndicesService) buildURL() (string, url.Values, error) {
  	// Build URL
  	var (
  		path string
  		err  error
  	)
  
  	if s.index != "" {
  		path, err = uritemplates.Expand("/_cat/indices/{index}", map[string]string{
  			"index": s.index,
  		})
  	} else {
  		path = "/_cat/indices"
  	}
  	if err != nil {
  		return "", url.Values{}, err
  	}
  
  	// Add query string parameters
  	params := url.Values{
  		"format": []string{"json"}, // always returns as JSON
  	}
  	if s.pretty {
  		params.Set("pretty", "true")
  	}
  	if s.bytes != "" {
  		params.Set("bytes", s.bytes)
  	}
  	if v := s.local; v != nil {
  		params.Set("local", fmt.Sprint(*v))
  	}
  	if s.masterTimeout != "" {
  		params.Set("master_timeout", s.masterTimeout)
  	}
  	if len(s.columns) > 0 {
  		params.Set("h", strings.Join(s.columns, ","))
  	}
  	if s.health != "" {
  		params.Set("health", s.health)
  	}
  	if v := s.primaryOnly; v != nil {
  		params.Set("pri", fmt.Sprint(*v))
  	}
  	if len(s.sort) > 0 {
  		params.Set("s", strings.Join(s.sort, ","))
  	}
  	return path, params, nil
  }
docs: // buildURL builds the URL for the operation.