Skip to content

Commit

Permalink
fix(api): gosec linter warning in file router
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Sep 12, 2024
1 parent ac98729 commit eb67513
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/router/file_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,20 +342,20 @@ func (r *FileRouter) List(c *fiber.Ctx) error {
var res *service.FileList
id := c.Params("id")
userID := GetUserID(c)
var page int64
var page int
if c.Query("page") == "" {
page = 1
} else {
page, err = strconv.ParseInt(c.Query("page"), 10, 64)
page, err = strconv.Atoi(c.Query("page"))
if err != nil {
page = 1
}
}
var size int64
var size int
if c.Query("size") == "" {
size = FileDefaultPageSize
} else {
size, err = strconv.ParseInt(c.Query("size"), 10, 64)
size, err = strconv.Atoi(c.Query("size"))
if err != nil {
return err
}
Expand Down

0 comments on commit eb67513

Please sign in to comment.