Re:Map[string]interface{} in Go: a user's manual
by stevebmark on Monday July 26, 2021 @04:19PM
(#27964890)
Why does the syntax specifically use `interface{}` instead of just `interface`? `{}` isn't use for any other types
[ Parent
| on HN ]
Re:Map[string]interface{} in Go: a user's manual
by ibraheemdev on Monday July 26, 2021 @04:21PM
(#27964925)
`interface` isn't a type, it's the keyword used to declare an interface:
type Foo interface {
Foo() int
}
`interface{}` is simply a shortform for an interface with no methods.