reslice the output if it's beyond length of 'lim'

This commit is contained in:
kim 2025-03-26 21:43:01 +00:00
commit 5ef24340f7
2 changed files with 84 additions and 109 deletions

View file

@ -29,14 +29,14 @@ import (
// on the paging order, the cursor value gets
// updated while maintaining the boundary value.
func nextPageParams(
curLo, curHi string,
page *paging.Page,
nextLo, nextHi string,
order paging.Order,
) (lo string, hi string) {
) {
if order.Ascending() {
return nextLo, curHi
page.Min.Value = nextLo
} else /* i.e. descending */ { //nolint:revive
return curLo, nextHi
page.Max.Value = nextHi
}
}