Fix up syntax error in README (#1155)
This commit is contained in:
parent
80f691159f
commit
ae9f03e6e8
@ -472,7 +472,7 @@ func main() {
|
||||
// Example for binding JSON ({"user": "manu", "password": "123"})
|
||||
router.POST("/loginJSON", func(c *gin.Context) {
|
||||
var json Login
|
||||
if err = c.ShouldBindJSON(&json); err == nil {
|
||||
if err := c.ShouldBindJSON(&json); err == nil {
|
||||
if json.User == "manu" && json.Password == "123" {
|
||||
c.JSON(http.StatusOK, gin.H{"status": "you are logged in"})
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user