从GitLab使用go get

使用私有仓库gitlab进行go依赖管理(go mod / go get)

// 编辑git配置文件 ~/.gitconfig
[url "git@gitlab.***.com:"]
    insteadOf = https://gitlab.***.com   

// 配置环境变量
GOPRIVATE=gitlab.***.com

// gitlab普通版本只能get2层
// 注意 common为gitlab的群组
gitlab.***.com/common/config  //称之为2层

// config 包的go.mod注意module名字
module gitlab.***.com/common/config
posted @ 2020-10-13 10:27  ruixing  阅读(1397)  评论(0编辑  收藏  举报