numutil

package
v7.0.1-rc Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JSONNumberType = reflect.TypeOf(json.Number(""))

JSONNumberType is the reflect.Type of encoding/json.Number. Marshaling code recognizes it and emits a DynamoDB N value so a decoded number that cannot be represented exactly by int64 or float64 survives a rewrite unchanged.

Functions

func ClampIntToInt32

func ClampIntToInt32(n int) int32

ClampIntToInt32 converts n to int32, clamping to the int32 range.

func ParseNumber

func ParseNumber(value string) (any, error)

ParseNumber converts a DynamoDB numeric string into a Go value that preserves the exact persisted value. Integers that fit int64 become int64; decimals that a float64 reproduces exactly become float64; every other valid number becomes json.Number so no precision is lost. Malformed input returns an error.

func ParseNumberSet

func ParseNumberSet(values []string) ([]any, error)

ParseNumberSet converts DynamoDB number-set elements with the same exactness guarantees as ParseNumber.

Types

This section is empty.

Jump to

Keyboard shortcuts

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