Skip to content
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

panic: '/hello/:name' in new path '/hello/:name' conflicts with existing wildcar #347

Open
Nemnon opened this issue Mar 25, 2022 · 0 comments

Comments

@Nemnon
Copy link

Nemnon commented Mar 25, 2022

`package main

import (
"fmt"
"github.com/julienschmidt/httprouter"
"log"
"net/http"
)

func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
fmt.Fprintf(w, "hello, %s!\n", ps.ByName("name"))
}

func main() {
router := httprouter.New()
router.ServeFiles("/*filepath", http.Dir("./templates"))
router.GET("/hello/:name", Hello)
log.Fatal(http.ListenAndServe(":8080", router))
}`

panic: '/hello/:name' in new path '/hello/:name' conflicts with existing wildcard '/*filepath' in existing prefix '/*filepath'

similark pushed a commit to similarweb/httprouter that referenced this issue May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant