去模块拉包的旧版本 [英] Go modules pulls old version of a package

查看:73
本文介绍了去模块拉包的旧版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用go模块将新包添加到我的项目中。这个软件包正在使用github.com/docker/docker/client,并且可以在项目外部正常工作。当我运行 go mod vendor 时,它将拉出v1.13.1版本的docker客户端软件包,该软件包没有我在代码中使用的某些方法,但是在go模块中标记为最新。我如何使go mod使用真正最新的软件包?

I'm trying to add a new package to my project with go modules. This package is using github.com/docker/docker/client and works fine outside of the project. When I run go mod vendor it pulls docker client package of version v1.13.1 which does not have some of the methods I am using in my code, but in go modules it is tagged as latest. How do I make go mod use the truly latest version of a package?

推荐答案

转到Wiki:模块:


何时需要时,可以使用诸如 go get foo@v1.2.3 go get foo @ master 去获取foo @ e3702bed2 ,或直接编辑 go.mod

如果您需要在 master 分支上进行最新提交,请使用

If you need the latest commit on the master branch, use

go get github.com/docker/docker/client@master

这篇关于去模块拉包的旧版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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