nils

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CastOrNil added in v0.6.1

func CastOrNil[T any](value any) T

func Coalesce added in v0.6.1

func Coalesce[T any](values ...*T) T

Coalesce Returns first no-nil value or panic if none

func Copy added in v0.6.1

func Copy[T any](value *T) *T

func IsNil

func IsNil[T any](t *T) bool

func IsNotNil

func IsNotNil[T any](t *T) bool

func OrDefault added in v0.6.1

func OrDefault[T any](value *T, defaultValue T) T

OrDefault Return value if no nil of default value in the another case

func OrDefaultF added in v0.14.0

func OrDefaultF[T any](value *T, defaultValue func() T) T

OrDefaultF Return value if no nil of default value from function in the another case

Types

This section is empty.

Jump to

Keyboard shortcuts

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