gpt4 book ai didi

go - dep 确保删除安装文件夹

转载 作者:IT王子 更新时间:2023-10-29 02:10:21 25 4
gpt4 key购买 nike

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

谢谢。

最佳答案

"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

中被删除

关于go - dep 确保删除安装文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48260010/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com