前置条件: go >= 1.13
设置GOPROXY
# 意思是拉取依赖时优先使用https://goproxy.cn,然后使用直连(direct)方式go env -w GOPROXY=https://goproxy.cn,direct
设置私服
# 基于域名的私服设置go env -w GOPRIVATE=*.socmap.org,*.socmap.net
权限问题
由于私有库需要权限认证,这里需要跳过http/https的用户认证,将http拉取转换为ssh拉取
git config --global url."gitlab@git.socmap.org:".insteadof "https://git.socmap.org"git config --global url."gitlab@git.socmap.net:".insteadof "https://git.socmap.net"
- 测试
go get git.socmap.org/yanmengfei/socpoc

