前置条件: go >= 1.13

    1. 设置GOPROXY

      1. # 意思是拉取依赖时优先使用https://goproxy.cn,然后使用直连(direct)方式
      2. go env -w GOPROXY=https://goproxy.cn,direct
    2. 设置私服

      1. # 基于域名的私服设置
      2. go env -w GOPRIVATE=*.socmap.org,*.socmap.net
    3. 权限问题

      由于私有库需要权限认证,这里需要跳过http/https的用户认证,将http拉取转换为ssh拉取

    1. git config --global url."gitlab@git.socmap.org:".insteadof "https://git.socmap.org"
    2. git config --global url."gitlab@git.socmap.net:".insteadof "https://git.socmap.net"
    1. 测试
      1. go get git.socmap.org/yanmengfei/socpoc
      image.png