go.mod 使用不带标签的模块

go.mod use modules without tags

我用gin-gonic休息API。

我有问题。

最新的标签是 v1.6.3 但在 master 分支中有一个我想使用的方法。

我要在 go.mod 中输入什么才能使用 master 分支而不是最新标签?

注:

更新:

这是我的 go.mod

go 1.15

require (
    github.com/gin-gonic/gin 16cd8cdd4ef9
)

但是当我 运行 去 mod 下载它自动更改为这个


go 1.15

require (
    github.com/gin-gonic/gin v1.6.3-0.20201025090830-16cd8cdd4ef9
    github.com/joho/godotenv v1.3.0
    gorm.io/driver/mysql v1.0.3
    gorm.io/gorm v1.20.5
)

它正在运行。

这应该可以通过遵循文档“How to Upgrade and Downgrade Dependencies

一个简单的go get example.com/package就足以修改go.mod并使用特定依赖项的最新版本。
要将依赖项及其所有依赖项升级到最新版本:

go get -u example.com/package

即:

go get foo updates to the latest version of foo.
go get foo is equivalent to go get foo@latest — in other words, @latest is the default if no @ version is specified.

并且:

A common mistake is thinking go get -u foo solely gets the latest version of foo.
In actuality, the -u in go get -u foo or go get -u foo@latest means to also get the latest versions for all of the direct and indirect dependencies of foo.

A common starting point when upgrading foo is instead to do go get foo or go get foo@latest without a -u (and after things are working, consider go get -u=patch foo, go get -u=patch, go get -u foo, or go get -u).