Re: [go-nuts] Re: Interface vs first-class function

2016-11-20 Thread 'Anmol Sethi' via golang-nuts
https://github.com/julienschmidt/httprouter https://github.com/pressly/chi and others actually use a function by default because it's the more common case. See https://github.com/pressly/chi/issues/94#issuecomment-254516724 On Mon, Nov 21, 2016 at 12:39 AM Tamás Gulácsi wrote: > I don't think

Re: [go-nuts] Re: Interface vs first-class function

2016-11-20 Thread Tamás Gulácsi
I don't think so. A http.Handler usually has a ton of state, so a struct's method is handier than a closure. And take a look at http.HandlerFunc! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving e

Re: [go-nuts] Re: Interface vs first-class function

2016-11-20 Thread 'Anmol Sethi' via golang-nuts
In relation to this question, do you guys think it would have been better had http.Handler been a function, not an interface? On Sun, Nov 20, 2016 at 11:23 PM Henry wrote: > Thanks for the replies. In terms of future extensibility, is it safe to > say that interface is superior to first-class fu