登录
首页 >  Golang >  Go问答

如何在 Github 上设置我的 Golang 项目版本

来源:stackoverflow

时间:2024-04-25 19:51:29 269浏览 收藏

小伙伴们有没有觉得学习Golang很有意思?有意思就对了!今天就给大家带来《如何在 Github 上设置我的 Golang 项目版本》,以下内容将会涉及到,若是在学习中对其中部分知识点有疑问,或许看了本文就能帮到你!

问题内容

我创建了一个 golang 项目。使用 dep 作为依赖管理。我可以引入github.com/gin-gonic/gin v1.4.0,但我不知道如何在我的项目中设置这个版本。

我正在尝试创建一个功能。 git checkout -b bate-0.0.1

修改gopkg.toml文件时出现错误

solving failure: no versions of github.com/sillyhatxu/go-utils met constraints:
        master: could not introduce github.com/sillyhatxu/go-utils@master, as it is not allowed by constraint beta-0.0.1 from project aftersales-backend.
        beta-0.0.1: could not introduce github.com/sillyhatxu/[email protected], as it is not allowed by constraint beta-0.0.1 from project aftersales-backend.
[[constraint]]
  name = "github.com/sillyhatxu/go-utils"
  version = "beta-0.0.1"

解决方案


我一直在解决这个问题。 golang使用git的tag功能进行版本控制。

git tag v0.0.1

git push origin --tags v0.0.1

gopkg.toml

[[constraint]]
  name = "github.com/sillyhatxu/go-utils"
  version = "0.0.1"

文中关于的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《如何在 Github 上设置我的 Golang 项目版本》文章吧,也可关注golang学习网公众号了解相关技术文章。

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>