condition

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And[T, U any](a T, b U) bool

And returns true if both a and b are truthy.

func Bool

func Bool[T any](value T) bool

Bool returns the truthy value of anything. If the value's type has a Bool() bool method, the method is called and returned. If the type has an IsZero() bool method, the opposite value is returned. Slices and maps are truthy if they have a length greater than zero. All other types are truthy if they are not their zero value.

func Nand

func Nand[T, U any](a T, b U) bool

Nand returns false if both a and b are truthy.

func Nor

func Nor[T, U any](a T, b U) bool

Nor returns true if neither a nor b is truthy.

func Or

func Or[T, U any](a T, b U) bool

Or returns false if neither a nor b is truthy.

func TernaryOperator

func TernaryOperator[T, U any](isTrue T, ifValue U, elseValue U) U

TernaryOperator checks the value of param `isTrue`, if true return ifValue else return elseValue.

func Xnor

func Xnor[T, U any](a T, b U) bool

Xnor returns true if both a and b or neither a nor b are truthy.

func Xor

func Xor[T, U any](a T, b U) bool

Xor returns true if a or b but not both is truthy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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