URL handling, I'm missing a fundamental concept


I posted a topic about my route processing not working, I thought my code was being hijacked in my program. I don’t believe that is the case now.

My route processing is acting strangely code below:

func (h userLogOut) registerRoutes() {
	http.HandleFunc("/logout", h.handleUserLogOut)
	http.HandleFunc("/logout/", h.handleUserLogOut)
} - displays the proper logout page - redirects to my index page - falls back to my logout page

I believe there is something fundamental I’m not understanding on how routes are processed in Go. Does anyone have a link to solid documentation I can read? If you understand what I’m missing a link to docs and an explanation would be fantastic.

Thank you kindly,

Using this code to test: https://play.golang.org/p/vcrgSvdgkH

If I visit / I see a

If i visit /logout I see b

If I visit /logout/ or /logout/try I see c

I suspect you have an issue with your browser caching a redirect or something else going on. Try a different browser or an incognito window or something along those lines to see if it helps.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.