Skip to content

Commit

Permalink
Changes based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
UyumazHakan committed Dec 6, 2022
1 parent c5cb835 commit 6a3677b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions es.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,17 +775,14 @@ func (c *Client) DeleteIndex(indexName string) error {
// Use case: You want to remove an index and all of its data. You also want to
// specify query parameters such as timeout.
func (c *Client) DeleteIndexWithQueryParameters(indexName string, queryParamMap map[string][]string) error {
queryParams := make([]string, len(queryParamMap))
queryParams := make([]string, 0, len(queryParamMap))
for key, value := range queryParamMap {
queryParams = append(queryParams, fmt.Sprintf("%s=%s", key,
strings.Join(value, ",")))
}
queryString := strings.Join(queryParams, "&")

var urlBuilder strings.Builder
urlBuilder.WriteString(fmt.Sprintf("%s?%s", indexName, queryString))

agent := c.buildDeleteRequest(urlBuilder.String())
agent := c.buildDeleteRequest(fmt.Sprintf("%s?%s", indexName, queryString))
var response acknowledgedResponse

err := handleErrWithStruct(agent, &response)
Expand Down

0 comments on commit 6a3677b

Please sign in to comment.