Hacker News new | past | comments | ask | show | jobs | submit login

It looks like this is the function: https://github.com/ChimeraCoder/anaconda/blob/master/twitter...

This looks like a good example of interface{} used correctly - the consumer of the apiGet function passes in their strongly typed object, which then is handed in to json.Decode. No type safety is lost from the perspective of the consumer, while the json.Decode can operate on any struct type.

Sure this addresses a different issue, but for all the complaints about interface{} I think this is a good use-case.




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

Search: