For example, we have a repo with structure as below
If the repo consumers hope to import client and api pkg, they have to import the whole module and indirectly import dependencies of server pkg.
Only three choices for this situation.
New git repo for client and api
New go.mod file and new git tag for client and api, e.g client/v0.1.0
New go.mod file and use replace directive
For choice 1, we have to manage more git repos and submit more PRs for a feature.
For choice 2, we have to tag api and client, then change the go.mod version and tag main module.
For choice 3, replace directive has some problems now.