在开发过程中可能会遇到这样的情况,有一些包是引入自不同地方的,比如:
golang.org/x/net/html
和 net/html
,golang.org/x/crypto
和 crypto
。那这是什么原因呢?
引用 Go 官方 Wiki 的说法:
The golang.org/x/... repositories are part of the Go Project but outside the main Go tree.
They are developed under looser compatibility requirements than the Go core. In general, they will support the previous two releases and tip.
大概意思就是,Go 标准库的包对向前兼容性有严格的标准。虽然 golang.org/x/...
系列包也是 Go 项目的一部分,但是在比 Go 标准库包更宽松的兼容性标准下开发,一般它们支持向前兼容两个版本。
golang.org/x/...
为官方的辅助包,是一种具有官方试验性质的包, 也就是说不排除有 BUG, 或者可能健壮性不是特别好;正式的标准库是有保障的包,前者有些成熟的功能会慢慢的放到标准库包里。
参考:
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有