doushang8846 2018-07-24 13:38
浏览 26
已采纳

Vgo和私有存储库

I am trying to introduce vgo to some of our company projects for dependency management, but I've encountered some issues related to private repository.

Let's assume that we have following code structure:

go/src/companyName/projectA/

go/src/companyName/projectB/

go/src/companyName/projectC/

All three projects have different git repository and projectA imports projectB.

With normal go build approach, as long as we had those directories in place (under git), all worked fine, however we cant't make it work with vgo wrapper.

On vgo build following error is being thrown:

companyName/projectA/ cannot find module providing package companyName/projectB/

Which kind of make sense because with vgo get -v I can see that vgo tries to get meta tags from https://companyName which cannot be exposed for company policy.

What's the best way to tell to vgo to either use file system contents (if source files are already there) or to specity git repository for certain import paths?

  • 写回答

1条回答 默认 最新

  • duanmanpi9358 2018-07-25 13:13
    关注

    One way of solving this is via the GOPROXY environment variable which can be set to a local file.

    export GOPROXY=file:///path/to/cache
    

    for more information, look at; https://github.com/golang/go/blob/master/src/cmd/go/testdata/mod/README

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM