Documentation
¶
Overview ¶
Package safecast provides bounded conversions for numeric values at protocol boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int32FromIntClamp ¶
Int32FromIntClamp converts v to int32, clamping to [math.MinInt32, math.MaxInt32]. Use at provider boundaries after validation (e.g. lipapi bounds max_output_tokens) so static analyzers see an explicit bound even when invariants already hold.
func IntFromInt64Clamp ¶
IntFromInt64Clamp converts v to int, clamping when v does not fit the platform int size. Use for telemetry and usage counters where silent truncation is worse than saturation.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.