Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ternary ¶
Ternary operator with a condition and two possible results. The condition is evaluated and the first result is returned if it is true, otherwise the second result is returned.
cond.Ternary(true, "yes", "no") // "yes" cond.Ternary(false, "yes", "no") // "no"
💣 Since go doesn't support lazy evaluation, so dereference a pointer will cause panic.
func TernaryFunc ¶ added in v0.4.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.