coalesce

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T any](target T, values ...T) T

Return the first element in the parameter list that is equal to the given target.

func Func

func Func[T any](test func(T) bool, values ...T) T

Return the first element in the parameter list that satisfies the given condition.

func NotEmpty

func NotEmpty[T EmptyConstraint](values ...T) T

Return the first NotNil element in the parameter list.

func NotNil

func NotNil[T any](values ...T) T

Return the first NotNil element in the parameter list.

func Ternary

func Ternary[T any](test bool, a T, b T) T

Types

type EmptyConstraint

type EmptyConstraint interface {
	[]interface{} | ~string
}

Jump to

Keyboard shortcuts

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