本文介绍了如何使用由dep管理的开发供应商软件包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在使用 dep 和供应商目录时使用包的开发副本/克隆?供应商目录包含在主存储库中。



例如,我分叉了包,并用我自己的github替换了它。我希望能够编辑代码,而不必为包的每次更改 git push + dep ensure 。

如果我在供应商目录中克隆软件包,那么我将无法将该目录提交到主库中,因为它被视为单独的存储库。 / p>

我试过一个把戏: .gitignore .git 来自包外的目录。这个效果很好,直到 dep确保运行, .git 目录被nuked。

$ b $根据,这样做没有内在的方式。



他们还建议不要直接修改供应商目录中的包,原因是我发现:在运行 dep确保

他们的主要建议是从 vendor / 目录中手动删除软件包,并将其修改为常规 $ GOPATH ,并在运行完成后运行 dep确保-update< pkg> 。



这比推动每次更改要好得多,但仍然需要手动 push / dep ensure 完成开发工作。


How can I use a development copy/clone of a package while using dep and a vendor directory? The vendor directory is included in the main repository.

For example, I have forked package and replaced it with my own on github. I want to be able to edit the code and not have to git push + dep ensure for each change of the package.

If I clone the package in the vendor directory, it I won't be able to commit that directory into the main repo because it's treated as a separate repository.

I tried a trick to .gitignore the .git directory from outside the package. This works well until dep ensure is run, where the .git directory is nuked.

解决方案

According to the dep docs, there is no inbuilt way of doing this as it stands.

They also recommend not modifying packages in the vendor directory directly, for the reasons I discovered: it gets nuked when running dep ensure.

Their main suggestion is to manually remove the package from the vendor/ directory, modify it in the regular $GOPATH, and running dep ensure -update <pkg> when finished development of it.

This is sufficiently better than pushing for each change, but still requires to manually push/dep ensure when completing the development work.

这篇关于如何使用由dep管理的开发供应商软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-14 05:57