diff --git a/content/en/docs/examples/bind-query-or-post.md b/content/en/docs/examples/bind-query-or-post.md index 7ebbe739c..2c7989e3e 100644 --- a/content/en/docs/examples/bind-query-or-post.md +++ b/content/en/docs/examples/bind-query-or-post.md @@ -32,7 +32,7 @@ func startPage(c *gin.Context) { // If `GET`, only `Form` binding engine (`query`) used. // If `POST`, first checks the `content-type` for `JSON` or `XML`, then uses `Form` (`form-data`). // See more at https://github.com/gin-gonic/gin/blob/master/binding/binding.go#L48 - if c.ShouldBind(&person) == nil { + if err := c.ShouldBind(&person); err == nil { log.Println(person.Name) log.Println(person.Address) log.Println(person.Birthday)