Documentation ¶ Overview ¶ Package bools contains the Compare and [Select] functions. Index ¶ func Compare[T ~bool](x, y T) int func IfElse[T any](condExpr bool, trueVal T, falseVal T) T Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Compare ¶ func Compare[T ~bool](x, y T) int Compare compares two boolean values as if false is ordered before true. func IfElse ¶ added in v1.80.0 func IfElse[T any](condExpr bool, trueVal T, falseVal T) T IfElse is a ternary operator that returns trueVal if condExpr is true otherwise it returns falseVal. IfElse(c, a, b) is roughly equivalent to (c ? a : b) in languages like C. Types ¶ This section is empty. Source Files ¶ View all Source files bools.go Click to show internal directories. Click to hide internal directories.