Skip to content

Commit

Permalink
free up resource
Browse files Browse the repository at this point in the history
Signed-off-by: William <[email protected]>
  • Loading branch information
kwesidev committed Apr 26, 2024
1 parent 81ebb33 commit c8da4de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/services/user_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (usrSrv *userService) List(offset int, limit int) ([]models.User, error) {
user.Roles = roles
users = append(users, user)
}
defer rows.Close()

return users, nil
}
Expand Down Expand Up @@ -187,6 +188,7 @@ func (usrSrv *userService) GetRoles(userId int) ([]string, error) {
rows.Scan(&role)
roles = append(roles, role)
}
defer rows.Close()
return roles, nil

}
Expand Down

0 comments on commit c8da4de

Please sign in to comment.