2 ms·
I don't think "empty" is quite the right mental model. It's an object that has at least 0 methods, which is a characteristic of every data type. An actually e
by jrockway 5y ago
I don't think "empty" is quite the right mental model. It's an object that has at least 0 methods, which is a characteristic of every data type. An actually empty type in Go is struct{} (good for map values when the map represents a set).
- LambdaComplex 5y agoTo be clear, "empty interface" is the official term: ctrl+f "empty interface" on https://golang.org/ref/spec https://golang.org/ref/spec
- ibraheemdev 5y agoWell the interface's method set is empty, not the underlying type.