bools

package
v1.80.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package bools contains the Compare and [Select] functions.

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳