Skip to content

Commit

Permalink
- if left less that 0 left = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
andreychuk committed Dec 1, 2016
1 parent d947d8a commit d173b92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions store/articles.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ func (art *ArticlesCollection) Read(query bson.M, fields bson.M, skip int, limit
return
}
left = total - (skip + count)
if left < 0 {
left = 0
}
return result, total, left, nil
}

Expand Down Expand Up @@ -189,6 +192,9 @@ func (art *ArticlesCollection) Search(q bson.M, skip int, limit int) (result []A
return
}
left = total - (skip + count)
if left < 0 {
left = 0
}
if err != nil {
return
}
Expand Down

0 comments on commit d173b92

Please sign in to comment.