You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 afoo
as well.The text was updated successfully, but these errors were encountered: