2 ms·
OK, thought you meant the interface{} thing people go for, since Go doesn't have generics. This Sort.Interface thing is indeed safe and performant. On the othe
by coldtea 12y ago
OK, thought you meant the interface{} thing people go for, since Go doesn't have generics.
This Sort.Interface thing is indeed safe and performant. On the other hand its not a solution to the problem we're discussing (that, to quote the parent, due to lack of generics "it is tedious to write library code in the language"). You still have to implement it all the time for all types despite having identical implementations.
So this doesn't show how it's not tedious. It just shows that it can be done in some way, which nobody doubted.