As the creator of Sinatra, I approve this:
Thanks for sharing.
Your example on that page says:
func main() {
m := pat.New()
m.Get("/hello/:name", http.HandlerFunc(hello))
http.ListenAndServe("localhost:5000", m)
}
I'd like to encourage you to suggest instead:
func main() {
m := pat.New()
m.Get("/hello/:name", http.HandlerFunc(hello))
http.Handle("/", m)
http.ListenAndServe("localhost:5000", nil)
}
so that packages using the default mux can still register
for specific paths. As written, your example does not
allow easy use of the net/http/pprof import to enable
profiling at /debug/pprof/*, while using http.Handle and
the nil argument to ListenAndServe does.
Russ