package bools
import "tailscale.com/types/bools"
Package bools contains the Int, Compare, and IfElse functions.
Index ¶
- func Compare[T ~bool](x, y T) int
- func IfElse[T any](condExpr bool, trueVal T, falseVal T) T
- func Int(v bool) int
Functions ¶
func Compare ¶
Compare compares two boolean values as if false is ordered before true.
func IfElse ¶
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 ¶
Int returns 1 for true and 0 for false.
Source Files ¶
bools.go
- Version
- v1.84.0 (latest)
- Published
- May 21, 2025
- Platform
- linux/amd64
- Last checked
- 1 day ago –
Tools for package owners.