Re:Go and Versioning: Minimal Version Selection
by pknopf on Wednesday February 21, 2018 @07:21PM
(#16434185)
If library authors can expose types of their dependencies, it still is an issue. Consumers must use the same exact version.
[ Parent
| on HN ]
Re:Go and Versioning: Minimal Version Selection
by bbatha on Wednesday February 21, 2018 @07:35PM
(#16434242)
That’s untrue. You will only be able import the library once and that version will be common across your all of your dependencies. Only major version breaks change this equation, but as explained in the third article those imports will have different names and are effectively different libraries.
Re:Go and Versioning: Minimal Version Selection
by pknopf on Wednesday February 21, 2018 @07:42PM
(#16434265)
Hmm, can I reference multiple versions of the same library?
Not that I'd want to, just wondering how it works.
Re:Go and Versioning: Minimal Version Selection
by stubish on Thursday February 22, 2018 @05:27AM
(#16436611)
Major versions of the same library are available, referenced by different paths.
It works if they don't reference any global resources outside of their own package. If they do reference any global resources (such as the using the standard flag package, paths on the filesystem, mutexes etc.), then things can fail badly. Yes, this means if one of your dependencies pulls in a different major version of a package than used by other dependencies, then they can end up duelling over resources.
Re:Go and Versioning: Minimal Version Selection
by bbatha on Wednesday February 21, 2018 @09:08PM
(#16434649)
vgo will guarantee that you only receive a single resolved minor version for any given major of a package. Each major will be imported as a different name, e.g. `import “registry.io/my/pkg”` for v1, `import “registry.io/my/pkg/v2”, etc. Because vendoring is disallowed by vgo that means that you don’t need to worry about issues like `import “registry.io/pkg”` conflicting with `import “yourlib/vendor/registry.io/pkg”`.