I'm pretty new to Go and really looking for some guidance.
In my application I have a channel that receives events, I'd like to have an interface like:
{
"type": "event1",
"data": {}
}
where the structure of data depends on the type.
Then the code that listen for those events in the channel will know what kind of structure to expect based on the type of the event.
How can I define such interface? Is that considered a good practice in Go?
Thanks in advance