Re:Termui – Go terminal dashboard
by robmccoll on Friday March 27, 2015 @03:59PM
(#9278653)
Perhaps you should instead be composing an XYZServiceResponse that implements the ServiceResponse interface?
[ Parent
| on HN ]
Can't json deserialize things to interface{} and then use members.
Good point - throw in a parent struct type.
Re:Termui – Go terminal dashboard
by ChikkaChiChi on Friday March 27, 2015 @05:44PM
(#9279223)
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>