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)