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

Migration to go.mod and module version #7

Open
combor opened this issue Jun 11, 2021 · 0 comments
Open

Migration to go.mod and module version #7

combor opened this issue Jun 11, 2021 · 0 comments

Comments

@combor
Copy link
Contributor

combor commented Jun 11, 2021

Hi, thanks for merging #6 so quickly.

We tried to install v2.0.1 using go get/install but unfortunately it complains about module versioning:

go install -v github.com/EngineerBetter/stopover/[email protected]
go install github.com/EngineerBetter/stopover/[email protected]: github.com/EngineerBetter/[email protected]: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2

We think the reason may be that the module was migrated to use gomod but only the minor version was incremented in the git tag. The module docs mention this:

Note that if you are adopting modules for the first time for a pre-existing repository or set of packages that have already been tagged v2.0.0 or higher before adopting modules, then the recommended best practice is to increment the major version when first adopting modules.

Basically go install doesn't recognize the version as coming from go mod and is using the older versioning mechanism as the previous v2.0.0 exists and doesn't have go.mod
More info can bee found here:
https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher

They also mention some alternative methods of migration that may be preferable if v3 is not desirable.

Would you be able to consider picking one of the migration options? If alternative methods are preferable we are keen to provide PR.

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

1 participant