大家推荐哪种golang包管理方式?

vendor特性肯定要用,否则远端的git库升级可能会导致接口不兼容。 谢谢。
已邀请:

astaxie - 创造、获取、分享、传播和应用Go

赞同来自: itfanr niugou niuniu left2right qiangmzsx

我们目前项目中使用的是godep,但是我最近尝试迁移到glide里面来,两个的功能都差不多,但是glide更强大一点,而且是Go1.5 vendor目录支持之后出来的,所以我还是比较推荐用这个。

这里列出来一些目前支持vendor的工具

* [manul](https://github.com/kovetskiy/manul) - Vendor packages using git submodules.
* [Godep](https://github.com/tools/godep)
* [Govendor](https://github.com/kardianos/govendor)
* [godm](https://github.com/hectorj/godm)
* [vexp](https://github.com/kr/vexp)
* [gv](https://github.com/forestgiant/gv)
* [gvt](https://github.com/FiloSottile/gvt) - Recursively retrieve and vendor packages.
* [govend](https://github.com/govend/govend)
* [Glide](https://github.com/Masterminds/glide) - Manage packages like composer, npm, bundler, or other languages.
* [Vendetta](https://github.com/dpw/vendetta)
* [trash](https://github.com/rancher/trash)
* [gsv](https://github.com/toxeus/gsv)
* [gom](https://github.com/mattn/gom)

九命猫

赞同来自: tanran 有鱼

在用gb

yougg

赞同来自: itfanr navigaid

`go get`支持`git submodule`

所以不需要其他的第三方包管理器
直接在`vendor`目录里面添加依赖的库为`submodule`就行了

airylinus

赞同来自: itfanr liushuchun

glide 很女子很弓虽大

astaxie - 创造、获取、分享、传播和应用Go

赞同来自: niugou

@kinta, 请看我在本地测试的,你是不是姿势不对,建议先升级到最新版本的glide再试试

```go
glide init
[INFO] Generating a YAML configuration file and guessing the dependencies
[INFO] Attempting to import from other package managers (use --skip-import to skip)
[INFO] Scanning code to look for dependencies
[INFO] --> Found reference to github.com/astaxie/beego
[INFO] --> Adding sub-package context to github.com/astaxie/beego
[INFO] --> Found test reference to github.com/smartystreets/goconvey/convey
[INFO] Writing configuration file (glide.yaml)
[INFO] Would you like Glide to help you find ways to improve your glide.yaml configuration?
[INFO] If you want to revisit this step you can use the config-wizard command at any time.
[INFO] Yes (Y) or No (N)?
Y
[INFO] Looking for dependencies to make suggestions on
[INFO] --> Scanning for dependencies not using version ranges
[INFO] --> Scanning for dependencies using commit ids
[INFO] Gathering information on each dependency
[INFO] --> This may take a moment. Especially on a codebase with many dependencies
[INFO] --> Gathering release information for dependencies
[INFO] --> Looking for dependency imports where versions are commit ids
[INFO] Here are some suggestions...
[INFO] The package github.com/astaxie/beego appears to have Semantic Version releases (http://semver.org).
[INFO] The latest release is v1.7.1. You are currently not using a release. Would you like
[INFO] to use this release? Yes (Y) or No (N)
N
[INFO] Would you like to remember the previous decision and apply it to future
[INFO] dependencies? Yes (Y) or No (N)
Y
[INFO] No proposed changes found. Have a nice day.
```

```go
cat glide.yaml
package: btest
import:
- package: github.com/astaxie/beego
subpackages:
- context
testImport:
- package: github.com/smartystreets/goconvey
subpackages:
- convey
```

chenmin

赞同来自: yuekcc

govendor
gopkg,侵入最小。不过这个是给作者准备的,使用者没得选。

xiayf - 程序员,译者,GO、Python、PHP、JS

godep

kinta - 90后 golang node.js开发工程师

glide

xieyanke - 职业打杂儿,业余编程……

glide真的很不错

kinta - 90后 golang node.js开发工程师

既然这么多人用glide,那问个glide的一个问题:
glide init 的时候,我发现会将绝对路径的package路径写入glide.yaml (譬如 Keepin/common 这个路径),这样子glide install就会报错。
有什么参数可以忽略吗?
在用 glide ,也解决了 fork 的问题。
https://github.com/gpmgo/gopm
简单易用。
期待官方的dep

stirlingx - https://github.com/liyue201

godep
https://github.com/golang/dep
godep 不拷贝test文件。

mrbdmm - 台电集团

glide 一枚

tpkeeper - Software Engineer. Gopher. [ tpkeeper.me@gmail.com ]

glide

suc

社区 好啊!!

qiangmzsx - 痛而不言,笑而不语,迷而不失,惊而不乱。

必须glide
目前都还没用过。。。

Mrwxj - 图样图森破

dep 最近在使用,感觉不错,毕竟亲生的
官方貌似又在搞新轮子~~~vgo

要回复问题请先登录注册