News for hackers. Stuff that matters.
Re:Map[string]interface{} in Go: a user's manual by enricozb on Monday July 26, 2021 @03:29PM (#27964191)
`map[string]interface{}` is just a map with string keys and `any` as a value, and is commonly used as the type for a JSON object. Unless you have a completely specified type for your JSON object (at that point might as well use a `struct` with all of the fields defined), the best you _could_ do would be something like a recursive type `type JSON = bool | string | []JSON | map[string]JSON` in some hypothetical version of Golang with recursive types and unions.

Also, if you're making a set, use `map[string]struct{}` instead of `map[string]interface{}` as `struct{}` takes 0 bytes whereas `interface{}` takes 8.

Re:Map[string]interface{} in Go: a user's manual by TJSomething on Monday July 26, 2021 @04:08PM (#27964727)
You could have a JSON value interface with methods like getType and getAsString, which would remove the overhead and type safety issues of reflection.