如何在golang中升级一个子包?

huangapple go评论117阅读模式
英文:

How do I upgrade one of the subpackages in golang?

问题

E.g.,github安全警报发出信号:

> 将github.com/opencontainers/runc升级到1.0.0-rc95版本或更高版本。例如:

如何在golang中进行最小代码更改?此包未在go.mod中声明(似乎是间接依赖)。

当我运行go get -u时,我可以看到一堆间接依赖项添加到我的go.mod中,这有点过度:

require (
	cloud.google.com/go v0.N.0 // indirect <--------

有没有一种直接更新该依赖项的方法?

英文:

E.g., github security alery signaled:

> Upgrade github.com/opencontainers/runc to version 1.0.0-rc95 or later. For example:

How can I do it in golang with minimal code changes? This package is not being declared in go.mod (seems like it's indirect dependency).

When I run go get -u, I can see a whole bunch of undirect dependencies added to my go.mod which is a bit overkill:

require (
	cloud.google.com/go v0.N.0 // indirect <--------

Is there a way to update directy that dependency?

答案1

得分: 1

确信go get -u github.com/opencontainers/runc就可以了。

英文:

Pretty sure go get -u github.com/opencontainers/runc should do it.

huangapple
  • 本文由 发表于 2021年9月27日 05:43:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/69339181.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定