问题描述

我使用go已有很短的时间了,并且我注意到Go(标准库)和golang.org/x/之间存在重复的软件包.

I've been using go for a short time now, and I've been noticing that there are duplicate packages between Go (standard library) and golang.org/x/.

我的问题是:为什么他们要发行两次?在这两个中,我应该使用哪一个(最新,规范等)?

My questions are: Why are they released twice? And of the two, which one should I use (more up-to-date, canonical, etc)?

到目前为止,我已经注意到一些已发布两次的示例软件包:

Some sample packages that are released twice that I've noticed so far:

 golang.org/x/net/html  net/html  golang.org/x/crypto  crypto 

推荐答案

这些软件包是Go项目的一部分,但在主Go树之外.它们是在比Go核心更宽松的兼容性要求下开发的.

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/
/x/

这篇关于golang.org软件包和标准库之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!