2019-03-25 11:35



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:

  branch = "master"
  name = "github.com/sirupsen/logrus"

  branch = "master"
  name = "github.com/stretchr/testify"

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

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

  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?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • duanhuang1967 duanhuang1967 2年前
    ignored = [

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

    点赞 评论 复制链接分享