javascript - 来自 Github 的 Go 依赖项 - 我们能否确定它们将永远可用?

标签 javascript go npm dependency-management

我担任 Javascript/NodeJs 开发人员已有几年,现在正在学习 Go。我对此很陌生。

似乎在 Go 中,大多数外部依赖项都是直接来自 Github 的。

我想知道我们在多大程度上可以依赖这一点。

当我们在 npm 上发布包时,它会作为副本、存档存储在注册表中。如果源存储库被删除,该包仍然可用。

在 Go 中,直接声明对模块存储库的依赖关系似乎很常见(例如在 Github 上)。

如果删除存储库会发生什么? 在这种情况下,所有依赖项目会发生什么情况?

最佳答案

今天的article on the Google Security Blog解释删除存储库时会发生什么:

Go guarantees the availability of packages. The Go Module Mirror serves packages requested by the go command, rather than going to the origin servers (such as GitHub). The first time any Go developer requests a given module, it’s fetched from upstream sources and cached within the module mirror. When a module has been made available under a standard open source license, all future requests for that module simply return the cached copy, even if the module is deleted upstream.

关于javascript - 来自 Github 的 Go 依赖项 - 我们能否确定它们将永远可用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76592222/

相关文章:

node.js - 在本地安装时如何让我的 NPM 包显示 "npm WARN prefer global"

node.js - 无法运行 Node : No such file or directory

javascript - 不要在 $location.hash 之后添加 hash 到 URL

javascript - 从数组数组中删除

go - 从配置文件中删除键值对?

Go: 读取 http.Request 中的方法

docker - 如何配置docker容器代理?

node.js - 可以将 npm 3.x 与 nodejs 4.x 一起使用吗?

javascript - turnjs4 翻页禁用我的脚本

javascript - 全局语法 : Breadth first traversal to get all items in a folder using Karma