我担任 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/