Better HN
topnewbestaskshowjobs
Log inSign up

cronos

467 karma · joined Oct 13, 2012 (14y ago) · 33 submissions

Submissions

comment 12y ago · link · parent

You're right. Thanks for explanation.

comment 12y ago · link · parent

I believe you have a race in that code on error channel. You can't guarantee that the value you send on it will be received by correct receiver. If you have 2 concurrent transfers and one errors and the other succeds, second one may receive an error intended for the first one.

comment 12y ago · link · parent

Why exactly do Resource's methods take variadic argument? In what scenario can there be more than one?

Also, small remarks about code: You define type HandleFunc in your package which is identical to http.HandlerFunc. Looks like it can be removed. Some error logging (rw.Write, json.Marshal) would be useful as well.

12