(Go Gin)Gin学习笔记(四)Gin的数据渲染和中间件的使用:数据渲染、返回JSON、浅.JSON()源码、中间件、Next()方法
1.数据渲染1.1各种数据格式的响应json、结构体、XML、YAML类似于java的properties、ProtoBuf1.1.1返回JSONpackagemainimport("github.com/gin-gonic/gin""net/http")funcmain(){r:=gin.Default()r.POST("/demo",func(res*gin.Context){res.JSON