常规配置:

go env -w GOPRIVATE=gitlab.example.com
go env -w GONOPROXY=gitlab.example.com

git config --global url."git@gitlab.example.com:".insteadOf https://gitlab.example.com/

groups目录下的仓库:

假如git仓库如下:

https://gitlab.example.com/company_name/group_name/project_name.git

此时go.mod里的module命名不能是:

gitlab.example.com/company_name/group_name/project_name

要在结尾加上.git

go mod init gitlab.example.com/company_name/group_name/project_name.git

这样就可以了

参考:Gitlab Subgroups and Go Modules Names - A place to gather bits and bytes.

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐