Skip to content

Commit

Permalink
fixed (gosec): defer the entire error function
Browse files Browse the repository at this point in the history
  • Loading branch information
alvin-reyes committed Mar 30, 2023
1 parent dcb5a74 commit 0273255
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions util/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ func NewBinder(log *zap.SugaredLogger) binder {
}

func (b binder) Bind(i interface{}, c echo.Context) error {
defer func() {
if err := c.Request().Body.Close(); err != nil {
b.log.Warnf("failed to close request body: %s", err)
}
}()


func (b Binder) Bind(i interface{}, c echo.Context) error {
defer func() {
if err := c.Request().Body.Close(); err != nil {
log.Warnf("failed to close request body: %s", err)
Expand Down

0 comments on commit 0273255

Please sign in to comment.