Go 1.18 introduce generics by the type parameter. 1. 2 built-in type params named `any` and `comparable` are not highlighted 2. The type constraint operator `|` and `~` are not recognized See the following live demo for more details. Refs: - [About go generics](https://go.dev/doc/tutorial/generics) - [Pygments live demo](https://pygments.org/demo/?lexer=go&style=default&formatter=html&code=type+Int+interface+%7B%0A++++int+%EF%BD%9C+int8+%7C+int16+%7C+int32+%7C+%7Eint64%0A%7D%0A%0Atype+Box%5BT1+any%2C+T2+comparable%5D+struct+%7B%0A++++v1+T1%0A++++v2+T2%0A%7D%0A%0Atype+Box2%5BT+comparable%5D+struct+%7B%0A++++v+T%0A%7D%0A%0Atype+Signed+interface+%7B%0A++++++++%7Eint%0A%7D%0A%0Afunc+IsSigned%5BT+Int%5D%28n+T%29+%7B%0A++++++++if+_%2C+ok+%3A%3D+%28interface%7B%7D%29%28n%29.%28Signed%29%3B+ok+%7B%0A++++++++++++++++fmt.Println%28%22signed%22%29%0A++++++++%7D+else+%7B%0A++++++++++++++++fmt.Println%28%22unsigned%22%29%0A++++++++%7D%0A%7D)
Go 1.18 introduce generics by the type parameter.
anyandcomparableare not highlighted|and~are not recognizedSee the following live demo for more details.
Refs: