Closed hjr3 closed 8 years ago
it's the good old function item vs function pointer problem. Each function has its own type that you can't mix just like that, so you have to cast them has function pointers. I think it should be enough to rewrite you first insertion as router.insert(Get, "/resizer", resize as fn(Context, Response));
and the rest should be coerced to the same type.
Huzzah! Thank you. I was aware this concept, but I never ran into it in practice. The error message makes slightly more sense now.
Yeah, the error message doesn't really make sense if you are used to all functions having the same type.
Error:
Code sample:
I am stumped as I am not sure what the error is complaining about?