Skip to content

Commit 3841945

Browse files
authored
Fixing error handling samples (#216)
1 parent 9aa0d21 commit 3841945

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

website/content/guide/binding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type User struct {
8080
```go
8181
e.POST("/users", func(c echo.Context) (err error) {
8282
u := new(User)
83-
if err = c.Bind(u); err != nil {
83+
if err := c.Bind(u); err != nil {
8484
return
8585
}
8686
// To avoid security flaws try to avoid passing bound structs directly to other methods
@@ -195,7 +195,7 @@ type CustomBinder struct {}
195195
func (cb *CustomBinder) Bind(i interface{}, c echo.Context) (err error) {
196196
// You may use default binder
197197
db := new(echo.DefaultBinder)
198-
if err = db.Bind(i, c); err != echo.ErrUnsupportedMediaType {
198+
if err := db.Bind(i, c); err != echo.ErrUnsupportedMediaType {
199199
return
200200
}
201201

0 commit comments

Comments
 (0)