-
Notifications
You must be signed in to change notification settings - Fork 609
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
BUG unknown field 'Username' ,'Password' in struct literal of type elasticsearch.Config #68
Comments
Hello, first of all, why are you using a configuration with so many empty fields, and why do you customize the default transport at all? Second, what version of Go and the package is this? Ie. can you paste the relevant |
I don't understand how go.mod works, it is go.mod not imported properly。now it is ok |
Cool, so it's OK to close the issue? |
Hi karmi, there is something fishy going on here. This is what I ran :
and this is what I get in the output:
version in go.mod file :
Can I get any help ? |
Hey! Can you remove this line from
Go perhaps resolves this to the initial version of the package, which didn't have the configuration fields. Sometimes IDEs and editor plugins mess up the import declarations. Use the import with the version suffix — the one you have points to a recent commit on the master branch:
Note: In general, use a major version of the package matching the major version of Elasticsearch. For example, if you're using Elastiscsearch 7.x, use either the |
|
As I'm saying, your editor might be adding this, but that line is incorrect — that points to a really old version. You have to remove the line. |
Got it!, Awesome. Works now after I changed that. |
You're welcome — glad that it's working! Note: Go resolver is a bit funky, note that it seems to point to version |
111/main.go:34:3: unknown field 'Username' in struct literal of type elasticsearch.Config
111/main.go:35:3: unknown field 'Password' in struct literal of type elasticsearch.Config
111/main.go:36:3: unknown field 'CloudID' in struct literal of type elasticsearch.Config
111/main.go:37:3: unknown field 'APIKey' in struct literal of type elasticsearch.Config
The text was updated successfully, but these errors were encountered: