util

package
v9.16.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atoi

func Atoi(b []byte) (int, error)

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string.

func Max added in v9.15.0

func Max(a, b int) int

Max returns the maximum of two integers

func Min added in v9.15.0

func Min(a, b int) int

Min returns the minimum of two integers

func MustParseFloat added in v9.9.0

func MustParseFloat(s string) float64

MustParseFloat is like ParseFloat but panics on parse errors.

func ParseFloat

func ParseFloat(b []byte, bitSize int) (float64, error)

func ParseInt

func ParseInt(b []byte, base int, bitSize int) (int64, error)

func ParseStringToFloat added in v9.9.0

func ParseStringToFloat(s string) (float64, error)

ParseFloat parses a Redis RESP3 float reply into a Go float64, handling "inf", "-inf", "nan" per Redis conventions.

func ParseUint

func ParseUint(b []byte, base int, bitSize int) (uint64, error)

func SafeIntToInt32 added in v9.15.0

func SafeIntToInt32(value int, fieldName string) (int32, error)

SafeIntToInt32 safely converts an int to int32, returning an error if overflow would occur.

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice.

func ToPtr added in v9.3.0

func ToPtr[T any](v T) *T

Types

This section is empty.

Jump to

Keyboard shortcuts

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