如何做“去获取”在github存储库的特定标签上 [英] How to do "go get" on a specific tag of a github repository

查看:151
本文介绍了如何做“去获取”在github存储库的特定标签上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用来编译InfluxDB数据库(版本v0.8.8)。go get github.com/influxdb/influxdb



但是这会拉动master分支,我需要 v0.8.8 标签。



I试图做:去获取github.com/influxdb/influxdb/releases/tag/v0.8.8 但这失败说不能找到。



我也试着去做一个正常的去获取的master分支,然后使用 git手工签出标签 in GOPATH / src / github ... 以设置相关版本。



<使用最后一种方法的问题是,当我尝试使用来获取依赖关系时,请获取-u -f ./... 它会尝试在主服务器中找到它们分支,其中一些分支不在主分支上...

TL; DR :执行 go在特定的github标签上获取,并且拉出正确的依赖关系。

解决方案

它使用 go get 工具是不可能的。相反,您需要使用第三方的包管理工具,或者为您希望管理更细粒度的包创建自己的分支。



向一个可以工作的人说道在谷歌,他承认这个问题/要求,他说他的团队使用的售货员体积很大,他们很可能很快就会用官方工具解决问题。

阅读全文:

参考第三方包管理工具
  • golang团队的博客文章讨论实施优惠活动的方法



  • Go



    供应商已将从实验版发布到1.6版(在这篇文章最初编写之后),它使得使用特定的过程成为可能更容易使用第三方工具的标签/版本的软件包。 go get 仍然没有提供特定标签或版本的功能。



    更多关于vendoring如何工作:< a href =https://blog.gopheracademy.com/advent-2015/vendor-folder/>了解并使用供应商文件夹


    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.

    解决方案

    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

    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

    这篇关于如何做“去获取”在github存储库的特定标签上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆