httprouter
httprouter copied to clipboard
Named parameter in the beginning of route is producing an wildcard route conflicts with existing children in path error
I have the two following routes declared in my application:
router := httprouter.New()
router.Handler("GET", "/meta/healthcheck", http.HandlerFunc(rts.HealthCheck))
router.Handler("GET", "/:an/pricing/prices/:sku/computed/:priceTable", http.HandlerFunc(rts.ComputePrice))
However, this is producing the following error:
panic: wildcard route ':an' conflicts with existing children in path '/:an/pricing/prices/:sku/computed/:priceTable'
From my understanding, I can't have both a parameter and a static value in the same path position, but I think this shouldn't be an issue.
I think this is a duplicate for https://github.com/julienschmidt/httprouter/issues/183