-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
go.mod does not specify v2 version #663
Comments
Looks like we would need a |
I am not familiar with mod yet, but I think go module can adapt git tag and gopsutil already has version aware git tags. And I don't want to version package directory like |
Please note that aside of breaking Go module standards as mentioned earlier in this issue, this repository also actively breaks the semantic versioning standard due to the patch version containing leading zeroes:
This leads to the side effect of Aside from highly advising you to actually pay attention to the Go modules specification and fixing the incorrect import path, I would at least either re-release the current version tag as v2.19.5 or create a new release as v2.19.6 to ensure users are working with the latest release. |
I'm not sure why the go mod thinks v.2.18.12 is newer than v2.19.05. Those are SemVer. |
Please re-read the paragraph I have quoted from the SemVer specifications page, which states |
ah, ok, understood. So, I tagged |
It seems that despite removing the leading zero,
Pulling
go.mod:
|
Because there is no And pull from latest will get So, there are two options here:
|
I really don't want to add |
Adding a |
Note, dependency has to be pinned to a specific release version commit hashes since it doesn't follow Go module v2+ guidelines. see: shirou/gopsutil#663 golang/go#34402
I did those combinations
on my local pc. but still have
I have tested on just my local pc, so it might be not affected, but those seem no luck. |
I am using |
|
The author has issues wrapping this into a correct module. See shirou/gopsutil#663
The author has issues wrapping this into a correct module. See shirou/gopsutil#663
Sorry for the very long time wait. I have released v3 by #938 which has go.mod. |
The go.mod file in this repo does not specify the /v2 tag so if this module is imported in any project, it will be imported with +incompatible
From the official documentation (https://github.com/golang/go/wiki/Modules)
The module path (such as module foo/v2) declared at the start of a module's go.mod file is both:
the definitive declaration of that module's identity
the definitive declaration of how that module must be imported by consuming code
A module can import a v2+ package that has not opted in to modules itself. A non-module v2+ package that has a valid v2+ semver tag will be recorded with an +incompatible suffix in the importing module's go.mod file. The +incompatible suffix indicates that even though the v2+ package has a valid v2+ semver tag such as v2.0.0, the v2+ package has not actively opted in to modules and hence that v2+ package is assumed to have not been created with an understanding of the implications of Semantic Import Versioning and how to use major versions in import paths. Therefore, when operating in module mode, the go tool will treat a non-module v2+ package as an (incompatible) extension of the v1 version series of the package and assume the package has no awareness of Semantic Import Versioning, and the +incompatible suffix is an indication that the go tool is doing so.
Tested this on centos linux and saw this in my go.mod file
github.com/shirou/gopsutil v2.18.12+incompatible
When I tested this, the current tag was 2.19.03
My go version
go version go1.11 linux/amd64
The text was updated successfully, but these errors were encountered: