【问题标题】:dep ensure removing the install foldersdep 确保删除安装文件夹
【发布时间】:2018-01-15 09:21:32
【问题描述】:

我已经使用以下命令安装了 httprouter 包

dep ensure -add github.com/julienschmidt/httprouter

      vendor
        └── github.com
            ├── julienschmidt
            │   └── httprouter

然后我已经安装了uuid包

dep ensure -add github.com/satori/go.uuid
  vendor
        └── github.com
            ├── satori

julienschmidt 路由器包消失了。为什么 dep 正在删除以前的安装?

删除 Gopkg.lock 上的条目

Gopkg.toml 有这个条目

[[constraint]]
  name = "github.com/julienschmidt/httprouter"
  version = "1.1.0"

[[constraint]]
  name = "github.com/satori/go.uuid"
  version = "1.2.0"

这会影响什么吗?

我的目录结构

gopath/src/github.com
- services
  - service-auth
  - service-signup
- vendor
   - github.com

谢谢。

【问题讨论】:

    标签: go godeps


    【解决方案1】:
    "github.com/julienschmidt/httprouter" is not imported by your project, and has been temporarily added to Gopkg.lock and vendor/.
    If you run "dep ensure" again before actually importing it, it will disappear from Gopkg.lock and vendor/.
    

    如果你只是运行dep ensure -add {package} 而不在代码中导入它。它将在接下来的 dep ensure 中删除。

    【讨论】:

    • 我在两个包上都有导入。我的供应商文件夹直接在我本地机器的 github.com 文件夹下。这会是个问题吗?
    • 高度可疑
    • 是的。我改变了目录结构。它的工作。
    • 你可以考虑在 dep github 中打开一个问题。 =]
    猜你喜欢
    • 2012-06-21
    • 1970-01-01
    • 2015-10-04
    • 2011-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-28
    • 2012-09-14
    相关资源
    最近更新 更多