Fix up syntax error in README (#1155)

This commit is contained in:
Richard Lee 2017-11-12 13:56:59 +08:00 committed by Bo-Yi Wu
parent 80f691159f
commit ae9f03e6e8

View File

@ -472,7 +472,7 @@ func main() {
// Example for binding JSON ({"user": "manu", "password": "123"}) // Example for binding JSON ({"user": "manu", "password": "123"})
router.POST("/loginJSON", func(c *gin.Context) { router.POST("/loginJSON", func(c *gin.Context) {
var json Login var json Login
if err = c.ShouldBindJSON(&json); err == nil { if err := c.ShouldBindJSON(&json); err == nil {
if json.User == "manu" && json.Password == "123" { if json.User == "manu" && json.Password == "123" {
c.JSON(http.StatusOK, gin.H{"status": "you are logged in"}) c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
} else { } else {