4 ms·
I don't see interface{} as a deficiency in the type system. Just about every type system has a method for storing "any" value such that it can then be upcast at
by kevincox 5y ago
I don't see interface{} as a deficiency in the type system. Just about every type system has a method for storing "any" value such that it can then be upcast at runtime.
The problem in Go isn't with interface{} but that the simple type system can't handle common use cases so you end up needing it use interface{} much more often that you would need to in other languages.
Basically interface{} is useful when you truly need it. But it is often used to workaround deficiencies in the type system.