go-elasticsearch
go-elasticsearch copied to clipboard
Use a pointer for BaseClient.productCheckMu
trafficstars
I would like to convert a TypedClient to a regular Client; my main use-case for this is so I can use it for the bulk indexer.
Converting a TypedClient to Client is fairly straight-forward:
func ToClient(tc *elasticsearch.TypedClient) *elasticsearch.Client {
c := &elasticsearch.Client{
BaseClient: tc.BaseClient,
}
c.API = esapi.New(c)
return c
}
Which works, but also gives an error on go vet;
literal copies lock value from ns.TypedClient.BaseClient:
github.com/elastic/go-elasticsearch/v8.BaseClient contains sync.RWMutex
This fixes that.
💚 CLA has been signed
Thank you, however I'm closing this in favor of #957