3 ms·
I don't see how it's not type covariance. Go's slices are generic to the extent needed, and the subtyping of Go's interfaces fits the requirements for ordering
by Jabbles 11y ago
I don't see how it's not type covariance.
Go's slices are generic to the extent needed, and the subtyping of Go's interfaces fits the requirements for ordering of types well enough.
- pcwalton 11y agoIn Go, if T implements interface I, T is not a subtype of the interface type I. T can be converted to the interface type I, but it's not a subtype.
- sgeop 11y agoWhat's the difference though? Is this true of interfaces in Java for instance, or does it have to do with the specific implementation of go?