dqg2269 2015-05-12 10:43
浏览 265
已采纳

如何在github仓库的特定标签上“获取”

I am trying to compile the InfluxDB database (version v0.8.8) using go get github.com/influxdb/influxdb

But this pulls the master branch, and I need the v0.8.8 tag.

I have tried to do: go get github.com/influxdb/influxdb/releases/tag/v0.8.8 but this fails saying unable to find.

I also tried to do a regular go get of the master branch, and then manually checking out the tag using git in GOPATH/src/github... in order to set the corret version.

The problem using the last approach is that when I try to pull the dependencies with go get -u -f ./... it tries to find them in the master branch, and some of them do not exist on the master branch...

TL;DR: perform go get on a specific github tag, and pull the correct dependencies.

  • 写回答

5条回答 默认 最新

  • dongsuo0517 2015-05-12 11:01
    关注

    It is not possible using the go get tool. Instead you need to use a third party go package management tool or create your own forks for the packages that you wish to manage more fine grained.

    Spoke to a guy that works at Google and he acknowledged this problem/requirement, he said that vendoring which his team used was bulky and they will probably solve it with the official tools soon.

    Read more:

    Vendoring in Go 1.6

    Vendoring has been released from experimental in go 1.6 (after this post was initially written) that makes the process of using specific tags / versions of packages using third party tools easier. go get does still not have the functionality to fetch specific tags or versions.

    More about how vendoring works: Understanding and using the vendor folder

    Modules in Go 1.11

    Go 1.11 has released an experimental features called modules to improve dependency management, they hope to release it as stable in Go 1.12: Information about modules in Go 1.11

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序