Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法创建或Gokpkg.toml与我在.go文件中导入的包同步?如果 myGopkg.toml为空并且我运行dep ensure,它会将我在代码中导入的所有包下载到vendor文件夹中,但不会更新Gopkg.toml文件。当我不得不迁移一个不使用包管理器的遗留项目时,它出现dep了. 有这样的命令吗?Gopkg.tomldep ensure -add ...
Gokpkg.toml
.go
Gopkg.toml
dep ensure
vendor
dep
dep ensure -add ...
删除您的Gopkg.toml文件并运行dep init,然后dep ensure. 它将创建您的Gopkg.toml文件并自动设置所有依赖项。
dep init