Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Better pattern is http://eagain.net/articles/go-json-kind/ Then you do one switch to get the correct message type to decode into, and boom, you can just `.Run` or `.Handle` or however you design the interface, and you are done.


Some variation of this is certainly what I would recommend. Elasticsearch API uses the GP's method, interestingly as it's a Java project?!, and is not that fun to work with in certain languages type systems :|




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: