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

version 6.15.3 is not usable with Go modules #1050

Closed
pierrre opened this issue Jun 11, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@pierrre
Copy link

commented Jun 11, 2019

According to the Go modules rules, a module with a "v2+" version must include the major version number in the path.
Currently, only v6.15.3 has a go.mod file, but:

  • the module line in go.mod doesn't end with /v6
  • the imports (internal sub-packages) are not using /v6

It causes several issues in my projects:

  • I must use the +incompatible suffix in the version number of go-redis
  • The "automatic update of dependencies" feature (go get -u all) is broken: it downgrades go-redis to 6.15.2

Solution: it would be great to fully support Go modules in v7:

  • add /v7 at the end on module in go.mod
  • rewrite the imports

If I remember correctly, they have added a compatibility mode for modules in "patch" version of previous Go minor versions.
So the older versions of Go shouldn't have any issue with /v7 in the path.

@vmihailenco

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

There are 2 different problems here:

  1. being fully "compatible" with go.mod
  2. version 6.15.3 is not usable with Go modules

I am going to ignore 1) for now because it is known behavior that does cause any real problems except +incompatible suffix.

As for the 2) v6.15.3 works just fine for me. How can I reproduce the problem? go get -u all updates all packages in $GOPATH so I doubt that is what you want to use with go modules.

@pierrre

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

How can I reproduce the problem?

One of my project is using Go modules, and imports go-redis.
So the go.mod file contains github.com/go-redis/redis v6.15.3+incompatible.

I'm periodically running go get -u all inside the directory of my project.
It is updating the dependencies of my current project to the latest version.
If I do that, it rollbacks the version of go-redis to v6.15.2+incompatible .

@pierrre

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

I just noticed that if I run go get -u (without all), it seems to do what I'm expecting.
Is it the correct way to do it ?

I added all in my command, because it didn't seem to update all my dependencies in my previous tests.
But maybe I'm wrong.

@pierrre

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

I'm closing the issue.
It seems that the way I use go get -u all is not correct.
Thank you.

@pierrre pierrre closed this Jun 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.