There is a private git site with address of gitlab.myownsite.com
, and the folder structure in the way of:
/common
|___ /libs
|___ /lib_a
|__ lib_a.mod
/somethingelse
Notice that, this is NOT folder structure of single project, it is structure of gitlab.myownsite.com
, which contain many repo in it. For example, I write a library lib_a
by Go, then create a repo at path gitlab.myownsite.com/common/libs/lib_a
, and its module name is:
module gitlab.myownsite.com/common/libs/lib_a
However, this naming disobeys the naming rule of github.com/username/reponame
, which cause another project which use my lib_a by:
import "gitlab.myownsite.com/common/libs/lib_a"
incorrectly parse to import subpackage lib_a of gitlab.myownsite.com/common/libs.git, the common
be recognized as username
, libs as reponame
, lib_a as packagename. go mod report error:
repository 'https://gitlab.myownsite.com/common/libs.git/' not found
I can not change the folder structure of this private gitlab site, how to solve this problem?
My go module env has: GOPRIVATE=gitlab.myownsite.com