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

x/vgo: proposal: warn if user code imports different versions of a library #24474

Closed
utrack opened this issue Mar 21, 2018 · 1 comment
Closed
Milestone

Comments

@utrack
Copy link

utrack commented Mar 21, 2018

I think vgo build should warn a user if his code imports two different versions of a same library (i.e. foo/v1 || foo/v2 || foo).

User needs to update import paths if foo releases a new version of a library (v2). But it is easy to forget to fix the import somewhere, which may lead to weird runtime and/or compile-time errors.

The mistake can be detected via go.mod listing, but it becomes impossible to detect if vendored code imports any version of a foo as well.

@gopherbot gopherbot added this to the vgo milestone Mar 21, 2018
@rsc
Copy link
Contributor

rsc commented Mar 27, 2018

This is an expected state, not something to warn about. In a large program it's not realistic to think that all uses of foo will update to the same version at the same time. The author of foo has to think about and plan for the fact that large builds will use both foo/v1 and foo/v2 and make them coexist nicely.

See the part about "gradual code upgrades" in blog.golang.org/versioning-proposal.

@rsc rsc closed this as completed Mar 27, 2018
@golang golang locked and limited conversation to collaborators Mar 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants