Skip to content

Commit

Permalink
Fix example code of Bind Uri (#2710)
Browse files Browse the repository at this point in the history
Need to pass a string to `gin.H` to show a message correctly.
  • Loading branch information
y-yagi committed May 1, 2021
1 parent 215c9ce commit 1acb459
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -930,7 +930,7 @@ func main() {
route.GET("/:name/:id", func(c *gin.Context) {
var person Person
if err := c.ShouldBindUri(&person); err != nil {
c.JSON(400, gin.H{"msg": err})
c.JSON(400, gin.H{"msg": err.Error()})
return
}
c.JSON(200, gin.H{"name": person.Name, "uuid": person.ID})
Expand Down

0 comments on commit 1acb459

Please sign in to comment.