intellij idea 占用内存太大?为什么这么大
特斯拉宣布将于 6 月 22 日开始 Robotaxi 公开试运营,这将对自动驾驶行业带来哪些影响?
IT行业夫妻双双被裁,想去新西兰闯一闯可以吗?
什么是微软式中文?
我的电脑硬件不支持硬解422 10bit***,但是用达芬奇可以编辑和导出,这是为什么?
知乎上有哪些被顶到高票的反智答案?

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?

发布日期:2025-06-23 01:40:15 浏览次数:0

最新的设计文档里面对这一块做了一个解释。

Why not use the syntax F like C++ and J***a? When parsing code within a function, such as v := F, at the point of seeing the < it's ambiguous whether we are seeing a type instantiation or an expression using the < operator. This is very difficult to resolve without type information. For example, consider a statement like a, b = w < x, y > (z) Withou…。

大部分语言都用尖括号<>表示泛型,为什么golang要标新立异用中括号?