News for hackers. Stuff that matters.
Re:Map[string]interface{} in Go: a user's manual by kevincox on Monday July 26, 2021 @02:58PM (#27963693)
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.

There are no comments on this comment yet.