News for hackers. Stuff that matters.
Re:Termui – Go terminal dashboard by bigdubs on Friday March 27, 2015 @12:10PM (#9277123)
Every time I have to write a duplicate XYZServiceResponse instead of ServiceResponse<XYZ>, I don't think "Hey I can't do stuff", I think "I have to copy and paste the same code AGAIN."
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?
Re:Termui – Go terminal dashboard by bigdubs on Friday March 27, 2015 @04:21PM (#9278750)
Can't json deserialize things to interface{} and then use members.
Re:Termui – Go terminal dashboard by robmccoll on Friday March 27, 2015 @05:22PM (#9279090)
Good point - throw in a parent struct type.

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

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?
Re:Termui – Go terminal dashboard by bigdubs on Friday March 27, 2015 @06:52PM (#9279563)
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>