bmizerany/pat — pull request #12 by zvin (2012-06-13 07:36:58+00:00)
Title: Fix slash match everything2

We should merge this binku87 commit, it fixes a panic with m.Get("/", http.HandlerFunc(...)) handlers :

2012/06/11 16:48:22 http: panic serving 127.0.0.1:36657: runtime error: index out of range
/usr/lib/go/src/pkg/net/http/server.go:576 (0x447bba)
_func_003: buf.Write(debug.Stack())
/build/buildd/golang-stable-1/src/pkg/runtime/proc.c:1443 (0x40fb00)
/build/buildd/golang-stable-1/src/pkg/runtime/runtime.c:128 (0x4105cc)
/build/buildd/golang-stable-1/src/pkg/runtime/runtime.c:85 (0x410473)
/home/alexis/go/src/github.com/zvin/pat/mux.go:217 (0x42756d)
com/zvin/pat.(*patHandler).try: if ph.pat[len(ph.pat)-1] == '/' {
/home/alexis/go/src/github.com/zvin/pat/mux.go:118 (0x426cc3)
com/zvin/pat.(*PatternServeMux).ServeHTTP: if _, ok := ph.try(r.URL.Path); ok {
/usr/lib/go/src/pkg/net/http/server.go:924 (0x43ca95)
(*ServeMux).ServeHTTP: mux.handler(r).ServeHTTP(w, r)
/usr/lib/go/src/pkg/net/http/server.go:656 (0x43ba26)
(*conn).serve: handler.ServeHTTP(w, w.req)
/build/buildd/golang-stable-1/src/pkg/runtime/proc.c:271 (0x40dc06)