Documentation
¶
Overview ¶
Package boolean defines boolean helpers.
Index ¶
- func AllTrue(values []bool) bool
- func And(values []bool) bool
- func AnyTrue(values []bool) bool
- func CountFalse(values []bool) int
- func CountTrue(values []bool) int
- func Equal(values ...bool) bool
- func IsTrue(v string) bool
- func NoneTrue(values []bool) bool
- func Or(values []bool) bool
- func Toggle(value bool) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllTrue ¶ added in v0.10.0
AllTrue checks if all values in the slice are true.
Returns:
- false if the slice is empty or contains at least one false value.
- true if all values are true.
func And ¶ added in v0.10.0
And performs a logical AND across all values in the slice.
Returns:
- false if the slice is empty or any value is false.
- true if all values are true.
func AnyTrue ¶ added in v0.10.0
AnyTrue checks if at least one value in the slice is true.
Returns:
- false if the slice is empty or contains no true values.
- true if at least one value is true.
func CountFalse ¶ added in v0.10.0
CountFalse counts the number of false values in the slice.
Returns:
- The number of elements in the slice that are false.
func CountTrue ¶ added in v0.10.0
CountTrue counts the number of true values in the slice.
Returns:
- The number of elements in the slice that are true.
func Equal ¶ added in v0.10.0
Equal checks if all values in the variadic argument list are equal.
Returns:
- true if all values are the same (either all true or all false).
- false if there is any inconsistency or the argument list is empty.
func IsTrue ¶
IsTrue checks if the provided string is a true value It accepts 1, t, T, TRUE, true, True. All other values are considered false.
func NoneTrue ¶ added in v0.10.0
NoneTrue checks if none of the values in the slice are true.
Returns:
- true if the slice is empty or contains no true values.
- false if at least one value is true.
Types ¶
This section is empty.