有什么可以做出高大上感觉 PPT 的小技巧?
Go 语言的使用感受是什么?
各位都在用Docker跑些什么呢?
理论上flutter性能应该非常高才对,为什么好些flutter应用性能一般?
中国人民抗日战争暨世界反法西斯战争胜利 80 周年纪念活动安排公布,将举行盛大阅兵,你有哪些期待?
为什么 mac mini 的 m4 版本价格这么低呢?

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

发布日期:2025-06-22 03:25: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要标新立异用中括号?