Some Go projects use multi-module approach, where top directory contains one module and subdir another. For example
- Nomad server https://github.com/hashicorp/nomad
- Nomad API https://github.com/hashicorp/nomad/tree/main/api
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?