Documentation
¶
Index ¶
- func Cast[To, From Numeric](v From) To
- func Clamp[T cmp.Ordered](v, min, max T) T
- func IsNil(v any) bool
- func IsNotNil(v any) bool
- func IsNotZero[T comparable](v T) bool
- func IsZero[T comparable](v T) bool
- func Max[T cmp.Ordered](a T, b ...T) T
- func Min[T cmp.Ordered](a T, b ...T) T
- func MinMax[T cmp.Ordered](a T, b ...T) (minRes, maxRes T)
- func Once[T any](v func() T) func() T
- func TypeAssert[To, From any](v From) To
- func TypeAssertTry[To, From any](v From) (To, bool)
- func Zero[T any]() T
- type Complex
- type Float
- type Integer
- type Numeric
- type Ordered
- type Signed
- type Unsigned
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNil ¶
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 IsNotZero ¶
func IsNotZero[T comparable](v T) bool
func IsZero ¶
func IsZero[T comparable](v T) bool
func TypeAssert ¶
func TypeAssert[To, From any](v From) To
func TypeAssertTry ¶
Types ¶
type Complex ¶
type Complex interface {
~complex64 | ~complex128
}
Click to show internal directories.
Click to hide internal directories.