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

github.com/gomodule/redigo/redis in multiple modules #485

Closed
leeqvip opened this issue May 21, 2020 · 9 comments · Fixed by #488
Closed

github.com/gomodule/redigo/redis in multiple modules #485

leeqvip opened this issue May 21, 2020 · 9 comments · Fixed by #488

Comments

@leeqvip
Copy link

leeqvip commented May 21, 2020

github.com/gomodule/redigo/redis: ambiguous import: found package github.com/gomodule/redigo/redis in multiple modules:
        github.com/gomodule/redigo v2.0.0+incompatible (/usr/local/go/workplace/pkg/mod/github.com/gomodule/[email protected]+incompatible/redis)
        github.com/gomodule/redigo/redis v0.0.0-20200429221454-e14091dffc1b (/usr/local/go/workplace/pkg/mod/github.com/gomodule/redigo/[email protected])
@leeqvip
Copy link
Author

leeqvip commented May 21, 2020

@garyburd

@stevenh
Copy link
Collaborator

stevenh commented May 21, 2020

What version of go are you using there?
We recently enabled gomod support so you should be seeing v1.X versions not v2.X

@fxk2006
Copy link

fxk2006 commented May 22, 2020

same issue

@silenceper
Copy link

same issue.

Because go.mod in my local project introduced a different version of redisgo.

@ppphp
Copy link
Contributor

ppphp commented Jun 4, 2020

I met the same question, and it can be solved. Do not use go get github.com/gomodule/redigo/redis in the current README.markdown, and try using go get github.com/gomodule/redigo

github.com/gomodule/redigo/redis v0.0.0-20200429221454-e14091dffc1b is a wrong dependency, which is introduced in the commit, and it was reverted later

So the solution is to find dependency with github.com/gomodule/redigo/redis in some go.mod, delete it and use github.com/gomodule/redigo instead, which should be github.com/gomodule/redigo v1.8.1 or something else.

@stevenh
Copy link
Collaborator

stevenh commented Jun 4, 2020

I can't reproduce this in a project which supports go.mod

> mkdir redis-test
> cd redis-test
> go mod init githib.com/stevenh/redis-test
go: creating new go.mod: module github.com/stevenh/redis-test
> go get github.com/gomodule/redigo/redis
go: downloading github.com/gomodule/redigo v1.8.1
go: found github.com/gomodule/redigo/redis in github.com/gomodule/redigo v1.8.1

Could you share your go.mod file?

@ppphp
Copy link
Contributor

ppphp commented Jun 5, 2020

I have a different outcome

me@me:~/hobby/redis-test$ go mod init githib.com/stevenh/redis-test
go: creating new go.mod: module githib.com/stevenh/redis-test
me@me:~/hobby/redis-test$ go get github.com/gomodule/redigo/redis
go: finding github.com/gomodule/redigo/redis latest
me@me:~/hobby/redis-test$ cat go.mod 
module githib.com/stevenh/redis-test

go 1.13

require github.com/gomodule/redigo/redis v0.0.0-20200429221454-e14091dffc1b // indirect

The behaviour is same in go1.14. It's very confusing.

os: ubuntu 2004, 5.4.0-31-generic x86_64 GNU/Linux
go version: go1.13, go1.14 managed by gvm

@stevenh
Copy link
Collaborator

stevenh commented Jun 20, 2020

I think you may have a bad cache try go clean -modcache before.

~/tst$ go clean -modcache
~/tst$ go mod init githib.com/stevenh/redis-test
go: creating new go.mod: module githib.com/stevenh/redis-test
~/tst$ go get github.com/gomodule/redigo/redis
go: downloading github.com/gomodule/redigo v1.8.2
go: downloading github.com/gomodule/redigo/redis v0.0.0-do-not-use
go: found github.com/gomodule/redigo/redis in github.com/gomodule/redigo v1.8.2
~/tst$ more go.mod
module githib.com/stevenh/redis-test

go 1.14

require github.com/gomodule/redigo v1.8.2 // indirect

@stevenh stevenh reopened this Jun 20, 2020
@stevenh
Copy link
Collaborator

stevenh commented Aug 7, 2020

Closing due to no response, feel free to reopen if this is still an issue

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

Successfully merging a pull request may close this issue.

5 participants