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

narrow

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package narrow converts Go's int and int64 to the int32 the API contracts use for counts and page numbers. The conversion saturates at the int32 bounds, so a value too large for the wire is capped rather than wrapped into a negative number.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int32

func Int32[T ~int | ~int64](n T) int32

Int32 is n as an int32, capped at math.MinInt32 and math.MaxInt32.

func Uint32

func Uint32[T ~int | ~int64](n T) uint32

Uint32 is n as a uint32, capped at 0 and math.MaxUint32.

Types

This section is empty.

Jump to

Keyboard shortcuts

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