3 ms·
You could sort of do that using a Go module that points to all your other modules. Then anyone who depends on that will get the versions you specify (at a minim
by skybrian 5y ago
You could sort of do that using a Go module that points to all your other modules. Then anyone who depends on that will get the versions you specify (at a minimum).
But a problem is that they would also download all the modules you point at, whether they use them or not.
To fix that, the package system would need a "soft dependency" where, if a module exists, it must be at least the version indicated.
- infogulch 5y agoGood idea with "soft dependencies". You'd also need to make the go.mod RequireSpec version argument [1] optional so it can be overridden by the module group. require example.com/my-module-group 1.2.3 require example.com/some/module // selects minimum version specified by my-module-group [1]: https://go.dev/ref/mod#go-mod-file-require https://go.dev/ref/mod#go-mod-file-require I also noticed Workspaces [2] which I hadn't seen before. They look interesting, but appear to exist for a different purpose. Maybe workspaces with a bunch of replace directives & some cli tooling could emulate a system like what is described here. [2]: https://go.dev/ref/mod#workspaces https://go.dev/ref/mod#workspaces