-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
router match mistake, when define named pattern and simple pattern simultaneously #1
Comments
It can't support implicit matching. You should define |
There is Otherwise mathod on your demand |
In my opinion, simple pattern take precedence over named pattern, There is other situation package main
import (
"net/http"
"github.com/teambition/trie-mux/mux"
)
func main() {
router := mux.New()
router.Get("/a/b", func(w http.ResponseWriter, _ *http.Request, _ mux.Params) {
w.Write([]byte("hello world!\n"))
})
router.Get("/:name/b", func(w http.ResponseWriter, _ *http.Request, _ mux.Params) {
w.Write([]byte("index\n"))
})
http.ListenAndServe(":8080", router)
}
|
Currently it is enough for practice usage with high performance. Don't make logic intricacy. |
Yes, beyond is as wrong as falling short. |
i think path
/a
should match pattern/:name
, but got response"/a" not implemented
. when match path, simple pattern take precedence over named pattern. https://github.com/teambition/trie-mux/blob/master/trie.go#L132The text was updated successfully, but these errors were encountered: