0

Some Go projects use multi-module approach, where top directory contains one module and subdir another. For example

When importing the submodule from api directory to my own project, it gets included with pseudo-version such as v0.0.0-20220310213507-4a21dbcfaa6e even though the git repository does have release tags. Trying to force specific release tag by running go get github.com/hashicorp/nomad/api@v1.2.6 will result in error:

go get: module github.com/hashicorp/nomad@v1.2.6 found, but does not contain package github.com/hashicorp/nomad/api

Why doesn't Go pick up release tags in this case?

tsaarni
  • 818
  • 1
  • 8
  • 18
  • 2
    Separate modules are versioned independently, and Go supports hierarchical git tags. The `api` module doesn't seem to be versioned for that project. See https://stackoverflow.com/questions/60601011/how-are-versions-of-a-sub-module-managed – JimB Mar 11 '22 at 18:44
  • Thank you @JimB! That is the correct answer. There should be tag `api/v1.2.6`. I submitted a request to the project to start versioning the submodule. – tsaarni Mar 15 '22 at 16:23

0 Answers0