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

Can't json deserialize things to interface{} and then use members.


Good point - throw in a parent struct type.

http://play.golang.org/p/oASRdqN0eQ


Good pull, but are there really that many use cases in production code where you need to consume JSON that you don't have an expectation of what types of data are coming your way?


if you have a standard ServiceResponse wrapper with meta information and a 'response' field that is the actual contents of the response. Leads to FooServiceResponse, BarServiceResponse vs. if you just have a generic ServiceResponse<T>




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

Search: