4 ms·
I recently added the statement "type T interface{}" to a piece of code, as a private joke about the generics-in-go talk. now my code looks like "func map(x []T
by dvirsky 13y ago
I recently added the statement "type T interface{}" to a piece of code, as a private joke about the generics-in-go talk.
now my code looks like "func map(x []T, f func(T) T)" and everybody's happy :)
- earthboundkid 13y agoI firmly believe that when Go introduces generics, the syntax should look like: type T1 generic type T2 generic func Map(f func(T1) T2, s []T1) []T2