bool

package
v0.0.0-...-0d409a9 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

func And(a, b bool) bool

Returns true if both a and b are true

func Guard

func Guard[T any](when bool, default_value T, alternative func() T) T

Run a callback function if the given bool is false, otherwise return the given default value

func LazyGuard

func LazyGuard[T any](when bool, default_value func() T, alternative func() T) T

Run a callback function if the given bool is true, otherwise return the given alternative callback

func Nand

func Nand(a, b bool) bool

Returns true if either a or b is false

func Nor

func Nor(a, b bool) bool

Returns true if both a and b are false

func Not

func Not(a bool) bool

Returns the opposite of a

func Or

func Or(a, b bool) bool

Returns true if either a or b is true

func ToInt

func ToInt(a bool) int

Returns 1 if a is true, 0 if a is false

func ToString

func ToString(a bool) string

Returns "True" if a is true, "False" if a is false

func Xnor

func Xnor(a, b bool) bool

Returns true if a and b are the same

func Xor

func Xor(a, b bool) bool

Returns true if a and b are different

Types

This section is empty.

Jump to

Keyboard shortcuts

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