go - golang.org 包和标准库的区别

标签 go

我使用 go 的时间很短,我注意到 Go(标准库)和 golang.org/x/之间存在重复的包。

我的问题是:为什么要发布两次?在这两者中,我应该使用哪一个(更新的、规范的等)?

到目前为止我注意到的一些发布两次的示例包:

  • golang.org/x/net/htmlnet/html
  • golang.org/x/cryptocrypto
  • 也许还有更多我现在想不起来的...

最佳答案

https://golang.org/pkg/#subrepo

These packages are part of the Go Project but outside the main Go tree. They are developed under looser compatibility requirements than the Go core.

除非您非常需要使用 /x/ 变体并且可以接受破坏性更改的风险,否则请使用标准库包。

关于go - golang.org 包和标准库的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42848636/

相关文章:

html - 在 Go 中使用 HTML/TEMPLATE 包时如何设置不同的内容类型

postgresql - 转到-pg-pg : can't find dst value for model id =","

Git:忽略已编译的 Google Go

go - 是否有推荐的方法来定义 slice 集合的常见行为?

go - 在 golang 中模拟内部函数

firebase - 在将用户添加到 Firebase 时从 Go 管理后端获取消息 token ,在 Javascript 中注册时结束

Go 的 git 库

git - 去获取 : Git settings are ignored

go - 为什么互斥锁比 golang 中的 channel 慢?

go - 是否有任何标准库可以将 float64 转换为具有固定宽度和最大有效位数的字符串?