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

Fix some panic information when multiple similar wildcards conflict #310

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jummyliu
Copy link

@jummyliu jummyliu commented May 8, 2020

  tree := &node{}
  tree.addRoute("/whose/:users/:name", fakeHandler("/whose/:users/:name"))
  tree.addRoute("/whose/:users/:user", fakeHandler("/whose/:users/:user")) // Wildcard Conflict panic

The second one will throw panic, but the information is not what I want (Maybe I don't completely understand it, this route /whose/:name is not defined). It likes below:

':user' in new path '/whose/:users/:user' conflicts with existing wildcard ':name' in existing prefix '/whose/:name'

I think below information are better.

':user' in new path '/whose/:users/:user' conflicts with existing wildcard ':name' in existing prefix '/whose/:users/:name'

So I change it. :)

@julienschmidt julienschmidt added this to the v1.4 milestone Jul 26, 2020
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

Successfully merging this pull request may close these issues.

2 participants