package main

import (
"net/http"

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

func main() {

r := gin.Default()

group := r.Group("api/v1")
// {
group.GET("user", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"msg": "ok,get",
})
})
group.PUT("user", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"msg": "ok,put \n",
})
})
// }

r.Run()

}

go gin框架:路由分组Group_github

go gin框架:路由分组Group_github_02