drpiqlzrh62917192 2019-03-25 11:35
浏览 67
已采纳

使用gop的dep时如何从供应商文件夹中排除内部依赖性

I have a project that depends on two other projects in the internal git repo. Which is already present in GOPATH. The problem I am facing is that, dep-init -gopath will still copy those projects under vendor/ directory.

Consequently the GoLand IDE I am using is confused where from the dependency is to be resolved. (I want it to resolve from GOPATH and not Vendor directory) If I delete the vendor/ directory, the program will run.

My Gopkg.toml file looks like:

[[constraint]]
  branch = "master"
  name = "github.com/sirupsen/logrus"

[[constraint]]
  branch = "master"
  name = "github.com/stretchr/testify"

[[constraint]]
  branch = "master"
  name = "gitlab.internal.com/vapi/goabc"

[[constraint]]
  branch = "master"
  name = "gitlab.internal.com/vapi/goxyz"

[prune]
  go-tests = true
  unused-packages = true

Where "gitlab.internal.com/vapi/goabc" and "gitlab.internal.com/vapi/goxyz" are the internal projects that this project depends on.

I tried adding the dependencies to ignored list [https://golang.github.io/dep/docs/Gopkg.toml.html#ignored]

But goxyz and goabc are still downloaded to vendor/ How can I get rid of them from the vendor directory?

  • 写回答

1条回答 默认 最新

  • duanhuang1967 2019-03-25 11:49
    关注
    ignored = [
      "gitlab.internal.com/vapi/goabc*",
      "gitlab.internal.com/vapi/goxyz*"
    ]
    

    Did the trick, earlier I hadn't placed the wildcard and other package imports forced the dep to download the project anyway.

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

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog