condition

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(conditions ...bool) bool

All ... Check if all boolean conditions satisfy

func Any

func Any(conditions ...bool) bool

Any ... Check if any boolean conditions satisfy

func HasLetter

func HasLetter(s string) bool

HasLetter ... Check if a string contains letter

func HasNumber

func HasNumber(s string) bool

HasNumber ... Check if a string contains number

func HasZeroValue

func HasZeroValue(values ...interface{}) bool

HasZeroValue ... Check if any value is the zero value of its type (e.g. nil, numeric 0, empty string) note: if value is invalid, it is regarded as zero

func Quaternary

func Quaternary(condition1, condition2 bool, both, cond1, cond2, neither interface{}) interface{}

Quaternary ... Return one result of: both conditions satisfy, cond1 satisfy, cond2 satisfy, neither satisfy

func Ternary

func Ternary(condition bool, a, b interface{}) interface{}

Ternary ... If condition satisfies, return a, else return b

Types

This section is empty.

Jump to

Keyboard shortcuts

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