Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a pointer for BaseClient.productCheckMu #905

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 13, 2024

  1. Use a pointer for BaseClient.productCheckMu

    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.
    arp242 committed Sep 13, 2024
    Configuration menu
    Copy the full SHA
    679a42b View commit details
    Browse the repository at this point in the history