4 ms·
It looks like this is the function: https://github.com/ChimeraCoder/anaconda/blob/master/twitter.go#L162 https://github.com/ChimeraCoder/anaconda/blob/master/tw
by jordwest 12y ago
It looks like this is the function:
https://github.com/ChimeraCoder/anaconda/blob/master/twitter.go#L162 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.