23 Commits

Author SHA1 Message Date
qm012
dfbc051df9 add more test and fix multiple params error 2021-07-04 15:12:24 +08:00
qm012
3fc08c9daf handle level 1 router
add more comments

update comment

add example

fix benchmark not found

add comment and update test method
gin_integration_test.go#L407

update comment and lastedNode directly assign current node

optimize code

Optimize the search next router logic

optimize code

Adjust the matching rules

Adjust the matching order

update condition code
2021-07-01 09:25:45 +08:00
raymonder jin
1d0f938f28
Fix insufficient slice check (#2755) 2021-06-25 13:22:01 +08:00
Yue Yang
2921582d11
Fix conflict between param and exact path (#2706)
* Fix conflict between param and exact path

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Add test

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Fix prefix conflict in exact paths

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Use backtracking

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* Fix panic

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>
2021-05-19 10:05:36 +08:00
Ross Wolf
f3de8132c5
Add mixed param and non-param paths (port of httprouter#329) (#2663)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2021-04-06 10:49:08 +08:00
Bo-Yi Wu
d17270dd90
Sync route tree to httprouter latest code (#2368)
* update tree

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update countParams

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* update

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* udpate

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix testing

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor gin context

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* add fullPath

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* chore: refactor

* remove unused code

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* remove varsCount

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* refactor

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-05-10 13:22:25 +08:00
thinkerou
7c21e04f62
fix maxParams bug (#2166) 2019-12-04 07:56:01 +08:00
Roman Zaynetdinov
35e33d3638 Hold matched route full path in the Context (#1826)
* Return nodeValue from getValue method

* Hold route full path in the Context

* Add small example
2019-05-26 08:20:21 +08:00
thinkerou
521d06c81d support bind uri param (#1612)
* support bind uri (1)

* uri binding successful run

* fix vet warning: github.com/gin-gonic/gin/internal.Param composite literal uses unkeyed fields

* fix code style

* update function name

* fix test function signature

* add test for CanSet

* update readme and add test case

* remove internal.Params

* add coverage

* fix warning
2018-11-22 09:29:48 +08:00
Barnabus
7a374f9a47 Fix typos (#1626) 2018-11-05 14:17:04 +08:00
田欧
a210eea3bd
improve panic information when a catch-all wildcard conflict occurs (#1529) 2018-09-21 10:21:59 +08:00
Iskander (Alex) Sharipov
df1e17c2f0 remove debug print statements from test code (#1540)
Found using https://go-critic.github.io/overview#commentedOutCode-ref
2018-09-12 09:13:16 +08:00
Boris Borshevsky
6f94fd05c9 Linting and optimizing struct memory signature. (#1184)
* fix cleanPath spell (#969)

* linter and optimize structs
2017-11-29 10:50:14 +08:00
Javier Provecho Fernandez
80942e67a8 docs(license): add julienschmidt/httprouter license URL 2017-06-27 22:58:49 +02:00
Javier Provecho Fernandez
3b8150c83c Revert "unify license (#942)"
This reverts commit 53799774f45a119234a89f791565e53aa26b4482.
2017-06-27 22:54:42 +02:00
田欧
53799774f4 unify license (#942) 2017-06-12 04:01:09 -05:00
Sergey Egorov
b1872ec369 The url.RawPath used when engine.UseRawPath is set to true. (#810) 2017-02-28 18:29:41 +08:00
Javier Provecho Fernandez
9e930b9bdd lint code 2016-04-15 01:16:46 +02:00
Manu Mtz.-Almeida
19b5f726f4 Fixes tree_test.go 2016-01-28 00:35:19 +01:00
Manu Mtz.-Almeida
b4963aa7de Updates tree_test.go 2016-01-28 00:28:16 +01:00
Manu Mtz-Almeida
eb3e9293ed Renames []HandleFunc to HandlersChain 2015-05-07 11:30:01 +02:00
Manu Mtz-Almeida
f212ae7728 Updates tree.go + fixes + unit tests 2015-05-05 16:37:33 +02:00
Manu Mtz-Almeida
0a192fb0fa Tons of unit tests 2015-04-09 12:15:02 +02:00