Imagine I have a repo github.com/user/golang-examples
and I provision to version each example module within it separately:
guthub.com/user/golang-examples
/modA
/go.mod
/pkgA1
/pkgA2
/modB
/go.mod
/pkgB1
/pkgB2
(I know the idiom is “one repo - one module” but there are usecases for multimodule projects, too, so this is not the subject of the discussion)
At the same time, semantic git tagging (v1.0.0
, v2.0.0
etc.) happens on the level of repo, not its subfolders. This makes it impossible to tag modules separately, for example
- First,
modA
overtakesmodB
in development by major version, and tagv2.0.0
is pushed at the repo level, with intent to versionmodA
- Later, when one wants to upgrade
modB
to v2, one can’t push the samev2.0.0
git tag for the second time to versionmodB
.
How can this task be accomplished in line with golang’s versioning paradigm? Again, this is about multi-module project. Obvious solution to split modules into repos is kind of unfavourable here because the overarching “examples” semantics of the top repo is desired.
Thanks!