mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Make sure golint pass on the code base
This commit is contained in:
parent
8781648af9
commit
bb8e61c7c5
59 changed files with 322 additions and 171 deletions
|
@ -5,10 +5,10 @@
|
|||
package controller
|
||||
|
||||
const (
|
||||
NbItemsPerPage = 100
|
||||
nbItemsPerPage = 100
|
||||
)
|
||||
|
||||
type Pagination struct {
|
||||
type pagination struct {
|
||||
Route string
|
||||
Total int
|
||||
Offset int
|
||||
|
@ -19,25 +19,25 @@ type Pagination struct {
|
|||
PrevOffset int
|
||||
}
|
||||
|
||||
func (c *Controller) getPagination(route string, total, offset int) Pagination {
|
||||
func (c *Controller) getPagination(route string, total, offset int) pagination {
|
||||
nextOffset := 0
|
||||
prevOffset := 0
|
||||
showNext := (total - offset) > NbItemsPerPage
|
||||
showNext := (total - offset) > nbItemsPerPage
|
||||
showPrev := offset > 0
|
||||
|
||||
if showNext {
|
||||
nextOffset = offset + NbItemsPerPage
|
||||
nextOffset = offset + nbItemsPerPage
|
||||
}
|
||||
|
||||
if showPrev {
|
||||
prevOffset = offset - NbItemsPerPage
|
||||
prevOffset = offset - nbItemsPerPage
|
||||
}
|
||||
|
||||
return Pagination{
|
||||
return pagination{
|
||||
Route: route,
|
||||
Total: total,
|
||||
Offset: offset,
|
||||
ItemsPerPage: NbItemsPerPage,
|
||||
ItemsPerPage: nbItemsPerPage,
|
||||
ShowNext: showNext,
|
||||
NextOffset: nextOffset,
|
||||
ShowPrev: showPrev,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue