1.安装gin
go get github.com/gin-gonic/gin
2.实例
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "hello world")
})
r.Run(":8001")
}