Govendor 不会导入更新版本

旧版本的golang.org/x/net/html有漏洞。哎呀!更好地升级软件包。两年前,我们使用govendor来建立我们的Shopify集成项目;所以让我们使用govendor来升级:


ip-192-168-3-40:Shopify-Gateway username$ git diff

ip-192-168-3-40:Shopify-Gateway username$ govendor fetch golang.org/x/net/html

ip-192-168-3-40:Shopify-Gateway username$ git diff

ip-192-168-3-40:Shopify-Gateway username$

州长什么也没做!这是vendor.json之后的文件fetch:


    {

        "checksumSHA1": "vqc3a+oTUGX8PmD0TS+qQ7gmN8I=",

        "path": "golang.org/x/net/html",

        "revision": "d997483c6db05184c79c182674d01f1e7b7553ae",

        "revisionTime": "2017-05-30T13:01:13Z"

    },

这是一个相当旧的版本,肯定比 2018 年 9 月 25 日的漏洞修复更旧。 Govendor 是一个较旧的软件包,似乎不再维护。我必须更换州长吗?有自然替代品吗?或者我做错了什么导致我无法更新我的软件包?


版本信息:


ip-192-168-3-40:Shopify-Gateway username$ govendor --version v1.0.9

ip-192-168-3-40:Shopify-Gateway username$ go version

go version go1.13.1 darwin/amd64

编辑:许多人建议使用 go 模块。我们不能使用它们!我们依赖于未版本控制的依赖项,当我们尝试将包升级为 go 模块时,此依赖项会下降到较低版本,从而引入数据库安全漏洞。我需要能够就地更新软件包,因为它们是由govendor安装的。


我还尝试安装我想要使用的 govendor 软件包的特定版本号:


ip-192-168-3-40:Shopify-Gateway username$ govendor fetch golang.org/x/net/html@d26f9f9a57f3fab6a695bec0d84433c2c50f8bbf

ip-192-168-3-40:Shopify-Gateway username$ git diff

ip-192-168-3-40:Shopify-Gateway username$

为什么州长不更新我的包裹?


料青山看我应如是
浏览 263回答 1
1回答

拉莫斯之舞

您必须迁移到go modules. 首先,创建一个新模块。通过这些简单的步骤,您将能够初始化模块并创建go.mod文件 [ https://stackoverflow.com/a/57944766/9361998]。比你必须输入:go mod init YOUR_REPOSITORY_NAMEgo clean go mod download # wait until dependencies are downloadedgo build #be sure that the code compilego mod tidy #prune unnecessary dependenciesgo get -u ./... #update dependencies请注意,使用latest 命令您将把dep 更新到最新的MINOR 补丁,请务必go.mod使用最新的MAJOR 版本更改文件编辑GOPATH另一种方法可以是在您使用的中下载模块go get -v -u github.com/repository_name/module_name。通过这种方式,该模块将被下载到您的GOPATH.
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go