我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在Golang中使用git2go在github中获取最新标签?

I am trying to get the latest github tag from my local repository in golang. For now I am getting all the tags, code is below:

repo, err := git.OpenRepository("/home/defiant/Temp/repo")
    checkErr(err)
    re, err := repo.Tags.List()
    checkErr(err)
    fmt.Println(re)

The result returned is of the format:

[0.1 1.3 1.4]

Here 1.3 is the latest tag. So can someone please help me out in getting only the latest tag?

近期文章

  • 使用Appengine标准时,重定向不会从POST切换到GET
  • Go and Google Calendar API
  • 如何通过未存储在golang的GAE或GCE中的应用程序使用Google Cloud DataStore API?
  • Golang结构定义模式
  • 与golang模板的差异最小?
  • 转到CSV文件解析
  • Glide管理的依赖项如何与构建一起使用?
  • 供应的Go依赖项无法导入
  • 扫描到gorm模型的结构
  • C gettimeofday无法与GoLang一起正常使用
  • 当我尝试连接到Postgresql时感到恐慌
  • Golang线程池调度程序的目的和顺序
  • 如何在Golang中将字符串转换为map [int] string
  • 在超级账本中找到呼叫者的姓名
  • GoLang中形状区域的计算误差[重复]
  • 在Golang中将数据写入文件时内存变高
  • gin-gonic无法处理中间件
  • beego模板-使用地图的键或值作为其他地图的键或将其传递给模板功能
  • 静态链接stdlib.so
  • Golang代码的运行速度比PHP中的相同代码慢

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华