mirror of
https://github.com/gin-gonic/gin.git
synced 2026-11-23 11:33:37 +08:00
docs: drop unnecessary braces in grouping routes example
Those bare blocks look like part of Group()'s API and confuse readers. The routes work the same without them. Fixes #3059
This commit is contained in:
parent
1bd0ecf2d3
commit
c689b5d77c
20
docs/doc.md
20
docs/doc.md
@ -391,20 +391,16 @@ func main() {
|
||||
router := gin.Default()
|
||||
|
||||
// Simple group: v1
|
||||
{
|
||||
v1 := router.Group("/v1")
|
||||
v1.POST("/login", loginEndpoint)
|
||||
v1.POST("/submit", submitEndpoint)
|
||||
v1.POST("/read", readEndpoint)
|
||||
}
|
||||
v1 := router.Group("/v1")
|
||||
v1.POST("/login", loginEndpoint)
|
||||
v1.POST("/submit", submitEndpoint)
|
||||
v1.POST("/read", readEndpoint)
|
||||
|
||||
// Simple group: v2
|
||||
{
|
||||
v2 := router.Group("/v2")
|
||||
v2.POST("/login", loginEndpoint)
|
||||
v2.POST("/submit", submitEndpoint)
|
||||
v2.POST("/read", readEndpoint)
|
||||
}
|
||||
v2 := router.Group("/v2")
|
||||
v2.POST("/login", loginEndpoint)
|
||||
v2.POST("/submit", submitEndpoint)
|
||||
v2.POST("/read", readEndpoint)
|
||||
|
||||
router.Run(":8080")
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user