Hi Gophers,Recently I was playing with go's http package and I ran into a few issues. Could someone help me with those and/or point me in the right direction (I'm on windows).
- When I map path to handlers inside http.HandleFunc("path/to/handle", handler) it uses case sensitive match. So if I declare '/home' and user types in '/Home' the server responds with 404 error. Is there any way to use case insensitive match
- My current setup is 2 handlers: one that handles "/home" (homecontroller) and serves a page and the other one "/" a fallthrough handler that serves CSS, JS, Images, Static html. The problem is I want default page "/" to be handled by homecontroller and all other pages by the fallthrough handler (something similar to "/*"). Can it be done?
- What is the idiomatic way to write a controller in go? One package per controller, one struct per controller (something scalable and maintainable)?
--Thank you.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I'm not sure what you mean by "You could wrap your handler with a function". Could you please give an example. I'm sure it is something obvious I just don't see it :)
Kevin,thank you. I assume you mean something like this (from my current implementation): http.HandleFunc("/Home", ignorePathCase(controller.Home))Isn't the handler called after the path is matched?
--
Kevin,thank you. I assume you mean something like this (from my current implementation): http.HandleFunc("/Home", ignorePathCase(controller.Home))
Isn't the handler called after the path is matched?
On Tuesday, March 5, 2013 7:09:41 PM UTC-6, Kevin Gillette wrote:
--