Skip to content

Commit

Permalink
Update README.md (#2804)
Browse files Browse the repository at this point in the history
1. c.FullPath() == "/user/:name/*action"
get following error:
evaluated but not used 
2. c.String(http.StatusOK, "The available groups are [...]", name)
get following error:
undefined: name
  • Loading branch information
goqihoo authored Aug 11, 2021
1 parent 6ebb945 commit b463b1c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,15 @@ func main() {

// 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
b := c.FullPath() == "/user/:name/*action" // true
c.String(http.StatusOK, "%t", b)
})

// This handler will add a new router for /user/groups.
// Exact routes are resolved before param routes, regardless of the order they were defined.
// Routes starting with /user/groups are never interpreted as /user/:name/... routes
router.GET("/user/groups", func(c *gin.Context) {
c.String(http.StatusOK, "The available groups are [...]", name)
c.String(http.StatusOK, "The available groups are [...]")
})

router.Run(":8080")
Expand Down

0 comments on commit b463b1c

Please sign in to comment.