1

我已经使用以下命令安装了 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

谢谢。

4

1 回答 1

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

于 2018-01-15T09:35:19.457 回答