【问题标题】:How to get the specified version(tag) of package by using go get?如何使用 go get 获取包的指定版本(标签)?
【发布时间】:2017-02-07 05:16:55
【问题描述】:

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

go get github.com/owner/repo

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

【问题讨论】:

标签: go


【解决方案1】:

Volker 是正确的,但这是在您的项目中使用特定版本的一种方法:

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

【讨论】:

  • 如果模块包含protoc等工具,请不要忘记在git checkout之后go install ./...
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-11-02
  • 2013-03-20
  • 2018-11-16
  • 1970-01-01
相关资源
最近更新 更多