79406003

Date: 2025-02-02 03:02:19
Score: 1
Natty:
Report link

Adding an updated answer here since I believe Go has implemented some new features in the standard library since this question was asked. Now you can simply do this:

http.HandleFunc("/smth", smthPage)
http.HandleFunc("/{$}", homePage)  // {$} represents the end of the URL
http.HandleFunc("/", custom404Page)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Jeremy French