Hold matched route full path in the Context (#1826)

* Return nodeValue from getValue method

* Hold route full path in the Context

* Add small example
This commit is contained in:
Roman Zaynetdinov
2019-05-26 03:20:21 +03:00
committed by 田欧
parent 78a8b5c9d5
commit 35e33d3638
6 changed files with 117 additions and 46 deletions

View File

@ -252,6 +252,11 @@ func main() {
c.String(http.StatusOK, message)
})
// For each matched request Context will hold the route definition
router.POST("/user/:name/*action", func(c *gin.Context) {
c.FullPath() == "/user/:name/*action" // true
})
router.Run(":8080")
}
```