2016-09-29 263 views
-1

如何使用go获取包的指定版本(标签)?如何使用go获取包的指定版本(标签)?

go get github.com/owner/repo

在上述命令中,如何指定包的版本或标签。

+1

你不能。一点也不。 – Volker

+1

[这个问题](http://stackoverflow.com/questions/24855081/how-do-i-import-a-specific-version-of-a-package-using-go-get)与你的问题有关。 – putu

+0

相关阅读此倡议:[地鼠,请标记您的发布](http://dave.cheney.net/2016/06/24/gophers-please-tag-your-releases) – icza

回答

1

沃尔克的是正确的,但这里的使用项目中的一个特定版本的方法:

go get github.com/sirupsen/logrus 
cd $GOPATH/src/github.com/sirupsen/logrus 
git checkout v0.9.0 
cd $GOPATH/src/github.com/YOU/PROJECT 
govendor add github.com/sirupsen/logrus # or similar 
相关问题