4 ms·
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 HandleFu
by cronos 13y ago
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.
- dougblack 13y agoAuthor. Great points. They don't need to be variadic. I misunderstood the type of url.Values. And I didn't see http.HandlerFunc! I eschewed error logging in the interest of simplicity. Thanks for the corrections! Updating the article now.