Help us shape the future of Go! Take the 2026 Go Developer Survey

paging

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package paging applies bounded offset/limit windows without integer overflow.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bounds

func Bounds(total, offset, limit int) (start, end int)

Bounds returns a safe half-open slice interval. A negative offset is treated as zero; a negative limit means no limit, while zero requests an empty page.

func Slice

func Slice[T any](items []T, offset, limit int) []T

Slice returns the requested page, preserving the source order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL