bools

package
v1.92.4-sing-box-1.13-... Latest Latest
Warning

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

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

Documentation

Overview

Package bools contains the Int, Compare, and IfElse 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

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.

func Int

func Int(v bool) int

Int returns 1 for true and 0 for false.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL