gvalue

package
v0.0.0-...-8d4abae Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cast

func Cast[To, From Numeric](v From) To

func Clamp

func Clamp[T cmp.Ordered](v, min, max T) T

func IsNil

func IsNil(v any) bool

IsNil reports whether v is nil.

It panics if v's Kind is not Interface or Ptr.

IsNil is equivalent to v == nil, but is more efficient.

func IsNotNil

func IsNotNil(v any) bool

func IsNotZero

func IsNotZero[T comparable](v T) bool

func IsZero

func IsZero[T comparable](v T) bool

func Max

func Max[T cmp.Ordered](a T, b ...T) T

func Min

func Min[T cmp.Ordered](a T, b ...T) T

func MinMax

func MinMax[T cmp.Ordered](a T, b ...T) (minRes, maxRes T)

func Once

func Once[T any](v func() T) func() T

func TypeAssert

func TypeAssert[To, From any](v From) To

func TypeAssertTry

func TypeAssertTry[To, From any](v From) (To, bool)

func Zero

func Zero[T any]() T

Types

type Complex

type Complex interface {
	~complex64 | ~complex128
}

type Float

type Float interface {
	~float32 | ~float64
}

type Integer

type Integer interface {
	Signed | Unsigned
}

type Numeric

type Numeric interface {
	Integer | Float
}

type Ordered

type Ordered interface {
	Integer | Float | ~string
}

type Signed

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

type Unsigned

type Unsigned interface {
	~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Jump to

Keyboard shortcuts

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