2016-09-29 311 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 
相關問題