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

Support for go modules breaks compatibility of paths for go1.10 #878

Closed
1 of 4 tasks
marcusljx opened this issue Aug 28, 2018 · 4 comments
Closed
1 of 4 tasks

Support for go modules breaks compatibility of paths for go1.10 #878

marcusljx opened this issue Aug 28, 2018 · 4 comments

Comments

@marcusljx
Copy link

marcusljx commented Aug 28, 2018

Please use the following questions as a guideline to help me answer
your issue/question without further inquiry. Thank you.

Which version of Elastic are you using?

  • elastic.v2 (for Elasticsearch 1.x)
  • elastic.v3 (for Elasticsearch 2.x)
  • elastic.v5 (for Elasticsearch 5.x)
  • elastic.v6 (for Elasticsearch 6.x)

Please describe the expected behavior

Using go1.10.2 with glide:

My glide configuration is:

- package: github.com/olivere/elastic
  version: ^6.0.0

My import statement is:

import "github.com/olivere/elastic"

Please describe the actual behavior

The client.go has an import error as it has this import statement:

	"github.com/olivere/elastic/v6/config"

The v6 directory is not imported by glide (used only with go modules), and hence on go1.10.2 this fails to build with the error:

vendor/github.com/olivere/elastic/client.go:24:2: cannot find package "github.com/olivere/elastic/v6/config"

Any steps to reproduce the behavior?

  • Downgrade to go1.10.2
  • Clone the repository to a project's .../vendor/github.com/olivere/elastic
  • run go vet
@olivere
Copy link
Owner

olivere commented Aug 28, 2018

For now, try:

- package: github.com/olivere/elastic
  version: 6.1.x

... and it should work again.

@olivere
Copy link
Owner

olivere commented Aug 28, 2018

Not sure about Glide, but it should also work for a recent version of Go, i.e. 1.10.3 or later. Those have minimal module-awareness.

@olivere
Copy link
Owner

olivere commented Aug 28, 2018

Sooner or later you probably have to move away from Glide, see their README. Right now, this doesn't help as dep has the same issues as Glide when it comes to supporting Go modules.

@olivere
Copy link
Owner

olivere commented Aug 28, 2018

You should be able to update to 6.2.2 which works out of the box again. I reverted the change to the import path.

@olivere olivere closed this as completed Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants