HandleFunc pattern question

70 views
Skip to first unread message

Joe McGuckin

unread,
Feb 17, 2023, 10:57:00 PM2/17/23
to golang-nuts
I'm going to want to handle URL's with no trailing suffix (e.g. foo.com/ or just foo.com) as well as URL's with a suffix (foo.com/plugh). I don't want to register a function for every possible URL suffix - I want to have two functions: one for the URL with no trailing suffix and once for any URL with a suffix.

How do I supply a pattern to HandleFunc that will differentiate between the two? The Docs say that a pattern of '/' will match anything, So, that's not quite what I want.

Thanks.

Joe
Reply all
Reply to author
Forward
0 new messages