p*****2 发帖数: 21240 | 1 Copy and Paste
A combination of interfaces and good ol’ copy and paste is the way Go
currently implements sortable slices. This is of course a terrible, terrible
idea. The names of your types will end up being StringSet, IntSet, and
FloatSet. When you find a bug you’ll be forced to go through all of the
instances where you copied and pasted, fix it and hope you don’t miss any.
This is clearly not a sustainable way to ‘implement’ generics. |
|