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

cannot load github.com/hashicorp/consul/api: ambiguous import #6019

Closed
wubo0067 opened this issue Jun 26, 2019 · 8 comments
Closed

cannot load github.com/hashicorp/consul/api: ambiguous import #6019

wubo0067 opened this issue Jun 26, 2019 · 8 comments

Comments

@wubo0067
Copy link

go version

go1.12.5 windows/amd64

go list -m all

github.com/hashicorp/consul v1.4.5
github.com/hashicorp/consul/api v1.1.0
github.com/hashicorp/consul/internal v0.1.0
github.com/hashicorp/consul/sdk v0.1.1

build error info

build github.com/hashicorp/consul: cannot load github.com/hashicorp/consul/api: ambiguous import: found github.com/hashicorp/consul/api in multiple modules:
        github.com/hashicorp/consul v1.4.5 (D:\develope\gopath\pkg\mod\github.com\hashicorp\consul@v1.4.5\api)
        github.com/hashicorp/consul/api v1.1.0 (D:\develope\gopath\pkg\mod\github.com\hashicorp\consul\api@v1.1.0)
@yarbelk
Copy link

yarbelk commented Jun 26, 2019

I am having this problem in pop_os, 19.04, OSX (some recent version),
with go version 1.12.5.

I'm getting this from importing go-micro
and have tried most combinations of replace and exclude that i can think of.

build github.com/tvlk-data/cdp-xperience-svc/cmd/client: cannot load github.com/hashicorp/consul/api: ambiguous import: found github.com/hashicorp/consul/api in multiple modules:                                                                                            
        github.com/hashicorp/consul v1.4.3 (/home/james/go/pkg/mod/github.com/hashicorp/consul@v1.4.3/api)
        github.com/hashicorp/consul/api v1.1.0 (/home/james/go/pkg/mod/github.com/hashicorp/consul/api@v1.1.0)

@gokanlam
Copy link

gokanlam commented Jun 26, 2019

I'm getting this from importing go-micro
and have tried most combinations of replace and exclude that i can think of.

You may pin consul to v1.5.1 @yarbelk

replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.5.1

@hellodudu
Copy link

I'm getting this from importing go-micro
and have tried most combinations of replace and exclude that i can think of.

You may pin consul to v1.5.1 @yarbelk

replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.5.1

It works.

@vearne
Copy link

vearne commented Nov 25, 2019

it works

@vearne
Copy link

vearne commented Nov 25, 2019

It help me much. Thank you.

@mark-libn
Copy link

谢谢,终于解决了这个问题了

@Linesmerrill
Copy link

My Savior @gokanlam 💯💯💯💯💯💯

@ghost
Copy link

ghost commented Jan 25, 2020

Hey there,

This issue has been automatically locked because it is closed and there hasn't been any activity for at least 30 days.

If you are still experiencing problems, or still have questions, feel free to open a new one 👍.

@ghost ghost locked and limited conversation to collaborators Jan 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants