diff options
author | 2017-11-27 21:30:04 -0800 | |
---|---|---|
committer | 2017-11-27 21:40:05 -0800 | |
commit | bb8e61c7c5d9f297bde207c6de07a5d4b67dcd29 (patch) | |
tree | 1d907010e659bbcf65c32df8d10fd91de97a8703 /server/ui/controller/pagination.go | |
parent | 8781648af9f730d8bd1a7d9c395c1f28f9058716 (diff) | |
download | v2-bb8e61c7c5d9f297bde207c6de07a5d4b67dcd29.tar.gz v2-bb8e61c7c5d9f297bde207c6de07a5d4b67dcd29.tar.zst v2-bb8e61c7c5d9f297bde207c6de07a5d4b67dcd29.zip |
Make sure golint pass on the code base
Diffstat (limited to 'server/ui/controller/pagination.go')
-rw-r--r-- | server/ui/controller/pagination.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/ui/controller/pagination.go b/server/ui/controller/pagination.go index b649d900..1d61f74f 100644 --- a/server/ui/controller/pagination.go +++ b/server/ui/controller/pagination.go @@ -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, |