w1100n
This site is best viewed in Google Chrome
gin
5/23/2019 21:31

https://github.com/gin-gonic/gin#quick-start

package main

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

func main() {
    router := gin.Default()
    router.GET("/path0", func(c *gin.Context) {
        firstname := c.DefaultQuery("params0", "Guest")
        lastname := c.Query("params1") // shortcut for c.Request.URL.Query().Get("lastname")

        c.String(http.StatusOK, "Hello %s %s", firstname, lastname)
    })
    router.Run(":8080")
}

<< Previous Posts Newer Posts >>
辽ICP备14012896