go gin多层路由嵌套示例

package main

import (
	"github.com/gin-gonic/gin"
)

func main() {
	r := gin.Default()

	api := r.Group("api")
	v1 := api.Group("v1")
	v1.GET("user", func(c *gin.Context) {
		c.String(200, "多层router")
	})

	r.Run()
}

 

https://img-blog.csdnimg.cn/a20c5b8854e34733ac877d5695f3a97b.png

 

搜索