3 ms·
Good point - throw in a parent struct type. http://play.golang.org/p/oASRdqN0eQ http://play.golang.org/p/oASRdqN0eQ
by robmccoll 12y ago
Good point - throw in a parent struct type.
http://play.golang.org/p/oASRdqN0eQ http://play.golang.org/p/oASRdqN0eQ
- ChikkaChiChi 12y agoGood 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?
- bigdubs 12y agoif 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>