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

route #2363

Closed
ganganlee opened this issue May 8, 2020 · 4 comments
Closed

route #2363

ganganlee opened this issue May 8, 2020 · 4 comments
Labels

Comments

@ganganlee
Copy link

product.GET("/:id",controller.GetProductById)
product.GET("/order/:id",controller.GetOrderWhitProduct)

When the two routes exist ,go build error

@DGKSK8LIFE
Copy link

product.GET("/:id",controller.GetProductById)
product.GET("/order/:id",controller.GetOrderWhitProduct)

When the two routes exist ,go build error

What's the build error that you get?
Have you considered the fact that you don't have a space in both controller.... after the commas?
Also, Are you sure that your method calls aren't incorrectly named (not the GIN ones, but the methods of controller)?

@DGKSK8LIFE
Copy link

It's probably either what I listed above, or that you just have two url ARGS with the same names.

@vishnukvmd
Copy link

Looks like it's a known limitation: #1681
You should instead try

product.GET("/:id",controller.GetProductById)
product.GET("/:id/order",controller.GetOrderWhitProduct)

@appleboy
Copy link
Member

appleboy commented May 9, 2020

Please move to #1681 to discuss.

@appleboy appleboy closed this as completed May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants