你现在的位置是:当前位置: 首页 >


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

更新时间:2025-06-22 15:30:16

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

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要标新立异用中括号?

案例推荐

case recommendation
  • 为什么小公司留不住人?

    查看案例

  • GraalVM用来跑Minecraft效果如何?

    查看案例

  • 遭遇生理性涨奶该怎么办?

    查看案例

  • 有哪些BI工具惊艳了你?

    查看案例

  • 怎么评价国内AI企业人肉背15块80TB硬盘,飞去马来西亚用英伟达训练数据,以规避美国禁令?

    查看案例

  • 据说go和c#的开发者都说自己比较节省内存,你们认为呢?

    查看案例

  • 韦东奕的牙怎么没了?

    查看案例

  • 雷军,是真的如表现的那么真诚吗?

    查看案例