我应该在go项目中使用git子模块吗?

时间:2015-03-06 09:16:57

标签: git go git-submodules

有一个用go语言编写的项目。它是使用git管理的。我应该使用git子模块还是只导入指令来使用第三方项目?

例如:

// Just use import directive.
import "github.com/3rd-party/dep"

// From a submodule.
$ cd myown
$ git add submodule https://github.com/3rd-party/dep dep
$ ...
import "github.com/myown/dep"

2 个答案:

答案 0 :(得分:2)

你应该使用import "github.com/3rd-party/dep" 然后在工作目录中运行go get

答案 1 :(得分:-3)

只需导入指令。 Git子模块的代表性很差。

相关问题