coerce

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncompatibleTypes = errors.New("incompatible types")
View Source
var ErrOverflow = errors.New("integer overflow: uint64 value too large for int64")

Functions

func Equal added in v1.15.0

func Equal(a, b zed.Value) bool

func Promote added in v1.15.0

func Promote(a, b zed.Value) (int, error)

func ToBool

func ToBool(val zed.Value) (bool, bool)

func ToFloat

func ToFloat(val zed.Value) (float64, bool)

func ToInt

func ToInt(val zed.Value) (int64, bool)

func ToNumeric added in v1.15.0

func ToNumeric[T constraints.Integer | constraints.Float](val zed.Value) T

func ToUint

func ToUint(val zed.Value) (uint64, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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