function
ListPageBounds
Normalize list paging and calculate safe half-open result bounds.
Arguments
| Argument | Type | Description |
|---|---|---|
page | int | Requested one-based page. |
limit | int | Requested page size. |
total | int | Total matching rows. |
Returns
Normalized paging and safe half-open result bounds.
(normalizedPage int, normalizedLimit int, start int, end int)Full signature
func ListPageBounds(
page,
limit,
total int,
) (normalizedPage, normalizedLimit, start, end int)