Gin Go Web Framework
===
感觉我不太喜欢iris的MVC模式,感觉太重了,还是轻量级的框架适合我一点
现在就开始Gin的学习之旅吧!
课程代码:[https://github.com/dollarkillerx/Gin-Study](https://github.com/dollarkillerx/Gin-Study)
### 课程环境:
- Ubuntu18.4
- Go1.12.5
- Ide: Goland
- vgo
### 老规矩先来一个HelloWorld
`vgo get -u github.com/gin-gonic/gin`
```
package main
import "github.com/gin-gonic/gin"
func main() {
app := gin.Default()
app.GET("/", func(ctx *gin.Context) {
ctx.JSON(200,gin.H{
"message":"Hello World",
})
})
app.Run(":8085")
}
```
### 原理
![](https://box.kancloud.cn/bfe660173dc3b1ac81cc5caf854a73a4_1329x607.png)