From 1acb459c10c51c708d57ccc23c382418fed641b2 Mon Sep 17 00:00:00 2001 From: y-yagi Date: Sat, 1 May 2021 14:57:22 +0900 Subject: [PATCH] Fix example code of `Bind Uri` (#2710) Need to pass a string to `gin.H` to show a message correctly. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e953f5..566e5cc 100644 --- a/README.md +++ b/README.md @@ -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})