安装
go get -u github.com/gin-gonic/gin
使用
import "github.com/gin-gonic/gin"import "net/http"
例子:输出”hello world”
package mainimport ("github.com/gin-gonic/gin""net/http")func main() {// 1、创建路由g := gin.Default()// 2、绑定路由规则,执行视图函数g.GET("/", func(c *gin.Context) {// 3、返回值c.String(http.StatusOK,"hello world")})// 4、开启监听g.Run(":8000")}

