You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
funcAuthMiddleware(next http.Handler) http.HandlerFunc {
returnfunc(w http.ResponseWriter, r*http.Request) { // >>> did not wrap with http.HandlerFuncnext.ServeHTTP(w, r)
}
}
the problem is at runtime these 3 behave very differently, my question is - do people see this as a problem and can it be rectified. I am getting all sorts of runtime errors by accidentally mixing these 3 things and it's driving me a little insane.
The text was updated successfully, but these errors were encountered:
It can be a bit confusing at first since there's quite a few concepts in the language at play simultaneously, but this is all working as intended, so I'm closing.
If you have thoughts about how the package should change in the future, #5465 is where that discussion is taking place.
What version of Go are you using (
go version
)?go version go1.10.4 linux/amd64
Problem
http.Handler / http.HandlerFunc types need be differentiated - things are compiling which shouldn't compile.
Say we have this func:
the above will compile. But so will this:
and so will this:
the problem is at runtime these 3 behave very differently, my question is - do people see this as a problem and can it be rectified. I am getting all sorts of runtime errors by accidentally mixing these 3 things and it's driving me a little insane.
The text was updated successfully, but these errors were encountered: