Documentation ¶ Index ¶ func Ternary[T any](condition bool, ifTrue, ifFalse T) T Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Ternary ¶ func Ternary[T any](condition bool, ifTrue, ifFalse T) T 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" Types ¶ This section is empty. Source Files ¶ View all Source files ternary.go Click to show internal directories. Click to hide internal directories.