News for hackers. Stuff that matters.
Re:A Proposal for Adding Generics to Go by uluyol on Tuesday January 12, 2021 @06:11PM (#25755334)
The any is required to avoid a syntactic ambiguity. It was that or use the "type" keyword as in Print[type T] / Print[type T1, T2 Constraint].

The question of what the syntax should look like has been beaten to death.

Re:A Proposal for Adding Generics to Go by alkonaut on Wednesday January 13, 2021 @03:42AM (#25759659)
There is ambiguity in Print[T](t T)? What different things could T represent there?
Re:A Proposal for Adding Generics to Go by ianlancetaylor on Wednesday January 13, 2021 @03:37PM (#25767638)
There is no ambiguity there. The ambiguity arises for parameterized types.

type A[T] int

Is that a parameterized type named A with a type parameter T, or is it a definition of an array named A whose length is T?

Separately, it's nice that type parameter lists use the same syntax as non-type parameter lists.