-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: do not pick obsolete v1 in automatic import selection #26238
Comments
Is there a proposed solution for this already? If not, what if vgo looks at the latest tag, and takes the commit the latest tag is at and then writes a something like |
The tricky part is how to detect when a major version switches from non-semantic import paths to semantic ones: if the repository is tagged But the key insight, I think, is that if the unversioned import path ever meant There is no reason to change the import path at that point, because the damage is already done. In fact, changing to a versioned import path would imply that there is no longer a single canonical import path for that package. The package maintainers are free to bump the major version again when they're ready to switch to a semantic import path, but we shouldn't try to push them to a new path when it doesn't break compatibility with up-to-date existing code. |
Change https://golang.org/cl/124384 mentions this issue: |
It's not OK that vgo selects the latest v1 when there is a v2 or later not written using semantic import versioning that has replaced the v1. Typically such an import is expecting the latest tag, not the last v1 (or v0).
Examples include github.com/coreos/etcd and k8s.io/client-go.
The text was updated successfully, but these errors were encountered: