These are chat archives for gin-gonic/gin

2nd
Feb 2019
Michael Aldridge
@the-maldridge
Feb 02 04:51

Evening all, I'm trying to reason out why the router isn't following good sense in an application I'm developing. I have the following snippet:

        hubs :=    v1.Group("hubs/")
                hubs.GET("/", s.getHubs)
                hubs.POST("/", s.newHub)
            hubs.GET("/:id", s.getHub)
            hubs.PUT("/update/:id",    s.modHub)
        hubs.PUT("/deactivate/:id", s.deactivateHub)
         hubs.PUT("/activate/:id", s.activateHub)
            hubDirector := hubs.Group("director/")
         hubDirector.GET("/:id",    s.getHubDirector)
        hubDirector.POST("/:id", s.setHubDirector)

I get the following error instead of it working:

panic: path segment 'director/:id' conflicts with existing wildcard ':id' in path '/v1/hubs/director/:id'
Given that this works in another module, I'm not quite sure why this doesn't work here